Browse Source

fixed short/long options

master
Andrea Luzzardi 17 years ago
parent
commit
9fb0a93ed1
1 changed files with 13 additions and 7 deletions
  1. +13
    -7
      pam_usb/src/pamusb-check.c

+ 13
- 7
pam_usb/src/pamusb-check.c View File

@ -90,13 +90,13 @@ int main(int argc, char **argv)
extern char *optarg; extern char *optarg;
char *short_options = "hc:s:dqD"; char *short_options = "hc:s:dqD";
struct option long_options[] = { struct option long_options[] = {
{ "help", 0, 0, 0},
{ "config", 1, 0, 0},
{ "service", 1, 0, 0},
{ "dump", 0, &dump, 1 },
{ "quiet", 0, &quiet, 1},
{ "debug", 0, &debug, 1},
{ 0, 0, 0, 0}
{ "help", 0, 0, 0 },
{ "config", 1, 0, 0 },
{ "service", 1, 0, 0 },
{ "dump", 0, 0, 0 },
{ "quiet", 0, 0, 0 },
{ "debug", 0, 0, 0 },
{ 0, 0, 0, 0 }
}; };
while ((opt = getopt_long(argc, argv, short_options, long_options, while ((opt = getopt_long(argc, argv, short_options, long_options,
@ -111,6 +111,12 @@ int main(int argc, char **argv)
conf_file = optarg; conf_file = optarg;
else if (opt == 's' || (!opt && !strcmp(long_options[opt_index].name, "service"))) else if (opt == 's' || (!opt && !strcmp(long_options[opt_index].name, "service")))
service = optarg; service = optarg;
else if (opt == 'd' || (!opt && !strcmp(long_options[opt_index].name, "dump")))
dump = 1;
else if (opt == 'q' || (!opt && !strcmp(long_options[opt_index].name, "quiet")))
quiet = 1;
else if (opt == 'D' || (!opt && !strcmp(long_options[opt_index].name, "debug")))
debug = 1;
else if (opt == '?') else if (opt == '?')
{ {
pusb_check_usage(argv[0]); pusb_check_usage(argv[0]);


Loading…
Cancel
Save