bin: stop supporting the hidden --usage

It's not used anywhere, not documented, and its output is slightly
broken with options that are too long.

* bin/common_setup.cc: Remove --usage support.
This commit is contained in:
Alexandre Duret-Lutz 2018-05-16 17:18:48 +02:00
parent f0b57d7264
commit 565e25502c

View file

@ -140,8 +140,6 @@ static const argp_option options_hidden[] =
{ "version", OPT_VERSION, nullptr, OPTION_HIDDEN, { "version", OPT_VERSION, nullptr, OPTION_HIDDEN,
"print program version", -1 }, "print program version", -1 },
{ "help", OPT_HELP, nullptr, OPTION_HIDDEN, "print this help", -1 }, { "help", OPT_HELP, nullptr, OPTION_HIDDEN, "print this help", -1 },
// We support this option just in case, but we don't advertise it.
{ "usage", OPT_USAGE, nullptr, OPTION_HIDDEN, "show short usage", -1 },
{ nullptr, 0, nullptr, 0, nullptr, 0 } { nullptr, 0, nullptr, 0, nullptr, 0 }
}; };
@ -154,10 +152,6 @@ parse_opt_misc(int key, char*, struct argp_state* state)
case OPT_HELP: case OPT_HELP:
argp_state_help(state, state->out_stream, ARGP_HELP_STD_HELP); argp_state_help(state, state->out_stream, ARGP_HELP_STD_HELP);
break; break;
case OPT_USAGE:
argp_state_help(state, state->out_stream,
ARGP_HELP_USAGE | ARGP_HELP_EXIT_OK);
break;
case OPT_VERSION: case OPT_VERSION:
display_version(state->out_stream, state); display_version(state->out_stream, state);
exit(0); exit(0);