FreeCalypso > hg > fc-pcsc-tools
comparison libcommon/globalopts.c @ 34:91bcf84a5323
-p reader selection implemented in fc-pcsc-atr
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Fri, 12 Feb 2021 17:39:18 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
33:8a4f3d00d997 | 34:91bcf84a5323 |
---|---|
1 /* | |
2 * This module implements parsing of global command line options. | |
3 */ | |
4 | |
5 #include <stdio.h> | |
6 #include <stdlib.h> | |
7 #include <unistd.h> | |
8 | |
9 extern unsigned select_reader_num; | |
10 | |
11 parse_global_options(argc, argv) | |
12 char **argv; | |
13 { | |
14 extern char *optarg; | |
15 int c; | |
16 | |
17 while ((c = getopt(argc, argv, "+p:")) != EOF) { | |
18 switch (c) { | |
19 case 'p': | |
20 select_reader_num = atoi(optarg); | |
21 continue; | |
22 case '?': | |
23 default: | |
24 /* error msg already printed */ | |
25 exit(1); | |
26 } | |
27 } | |
28 return(0); | |
29 } |