diff options
-rw-r--r-- | scripts/kconfig/conf.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c index 8d6f17490c5e..d4737d35e720 100644 --- a/scripts/kconfig/conf.c +++ b/scripts/kconfig/conf.c | |||
@@ -495,12 +495,12 @@ static void check_conf(struct menu *menu) | |||
495 | 495 | ||
496 | int main(int ac, char **av) | 496 | int main(int ac, char **av) |
497 | { | 497 | { |
498 | int i = 1; | 498 | int opt; |
499 | const char *name; | 499 | const char *name; |
500 | struct stat tmpstat; | 500 | struct stat tmpstat; |
501 | 501 | ||
502 | if (ac > i && av[i][0] == '-') { | 502 | while ((opt = getopt(ac, av, "osdD:nmyrh")) != -1) { |
503 | switch (av[i++][1]) { | 503 | switch (opt) { |
504 | case 'o': | 504 | case 'o': |
505 | input_mode = ask_new; | 505 | input_mode = ask_new; |
506 | break; | 506 | break; |
@@ -513,12 +513,7 @@ int main(int ac, char **av) | |||
513 | break; | 513 | break; |
514 | case 'D': | 514 | case 'D': |
515 | input_mode = set_default; | 515 | input_mode = set_default; |
516 | defconfig_file = av[i++]; | 516 | defconfig_file = optarg; |
517 | if (!defconfig_file) { | ||
518 | printf(_("%s: No default config file specified\n"), | ||
519 | av[0]); | ||
520 | exit(1); | ||
521 | } | ||
522 | break; | 517 | break; |
523 | case 'n': | 518 | case 'n': |
524 | input_mode = set_no; | 519 | input_mode = set_no; |
@@ -534,16 +529,19 @@ int main(int ac, char **av) | |||
534 | srandom(time(NULL)); | 529 | srandom(time(NULL)); |
535 | break; | 530 | break; |
536 | case 'h': | 531 | case 'h': |
537 | case '?': | 532 | printf("See README for usage info\n"); |
538 | fprintf(stderr, "See README for usage info\n"); | ||
539 | exit(0); | 533 | exit(0); |
534 | break; | ||
535 | default: | ||
536 | fprintf(stderr, "See README for usage info\n"); | ||
537 | exit(1); | ||
540 | } | 538 | } |
541 | } | 539 | } |
542 | name = av[i]; | 540 | if (ac == optind) { |
543 | if (!name) { | ||
544 | printf(_("%s: Kconfig file missing\n"), av[0]); | 541 | printf(_("%s: Kconfig file missing\n"), av[0]); |
545 | exit(1); | 542 | exit(1); |
546 | } | 543 | } |
544 | name = av[optind]; | ||
547 | conf_parse(name); | 545 | conf_parse(name); |
548 | //zconfdump(stdout); | 546 | //zconfdump(stdout); |
549 | switch (input_mode) { | 547 | switch (input_mode) { |