Skip to content

Commit a2af62c

Browse files
committed
kconfig: fix 'invalid option' for help option
scripts/kconfig/conf supports -? option to show the help message. This is not wired up to Makefile, so nobody would notice this, but it also shows 'invalid option' message. $ ./scripts/kconfig/conf -? ./scripts/kconfig/conf: invalid option -- '?' Usage: ./scripts/kconfig/conf [-s] [option] <kconfig-file> [option] is _one_ of the following: --listnewconfig List new options --helpnewconfig List new options and help text --oldaskconfig Start a new configuration using a line-oriented program ... The reason is the '?' is missing in the short option list passed to getopt_long(). While I fixed this issue, I also changed the option '?' to 'h'. I prefer -h (or --help, if a long option is also desired). Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
1 parent 102a1a7 commit a2af62c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scripts/kconfig/conf.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ int main(int ac, char **av)
494494

495495
tty_stdio = isatty(0) && isatty(1);
496496

497-
while ((opt = getopt_long(ac, av, "s", long_opts, NULL)) != -1) {
497+
while ((opt = getopt_long(ac, av, "hs", long_opts, NULL)) != -1) {
498498
if (opt == 's') {
499499
conf_set_message_callback(NULL);
500500
continue;
@@ -550,7 +550,7 @@ int main(int ac, char **av)
550550
case yes2modconfig:
551551
case mod2yesconfig:
552552
break;
553-
case '?':
553+
case 'h':
554554
conf_usage(progname);
555555
exit(1);
556556
break;

0 commit comments

Comments
 (0)