Commit a2af62c3 authored by Masahiro Yamada's avatar Masahiro Yamada
Browse files

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: default avatarMasahiro Yamada <masahiroy@kernel.org>
parent 102a1a72
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -494,7 +494,7 @@ int main(int ac, char **av)

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

	while ((opt = getopt_long(ac, av, "s", long_opts, NULL)) != -1) {
	while ((opt = getopt_long(ac, av, "hs", long_opts, NULL)) != -1) {
		if (opt == 's') {
			conf_set_message_callback(NULL);
			continue;
@@ -550,7 +550,7 @@ int main(int ac, char **av)
		case yes2modconfig:
		case mod2yesconfig:
			break;
		case '?':
		case 'h':
			conf_usage(progname);
			exit(1);
			break;