bin: add --usage back

Because it appears in some error messages we cannot remove.  Make
--usage as a synonym for --help.

* bin/common_setup.cc: Here.
This commit is contained in:
Alexandre Duret-Lutz 2018-05-20 17:36:24 +02:00
parent af3f62c1c8
commit 7b580e006a

View file

@ -130,6 +130,9 @@ static const argp_option options[] =
{
{ "version", OPT_VERSION, nullptr, 0, "print program version", -1 },
{ "help", OPT_HELP, nullptr, 0, "print this help", -1 },
// We support --usage as a synonym for --help because argp's
// hardcoded error message for unknown options mentions it.
{ "usage", OPT_HELP, nullptr, OPTION_HIDDEN, nullptr, -1 },
{ nullptr, 0, nullptr, 0, nullptr, 0 }
};
@ -138,6 +141,9 @@ static const argp_option options_hidden[] =
{ "version", OPT_VERSION, nullptr, OPTION_HIDDEN,
"print program version", -1 },
{ "help", OPT_HELP, nullptr, OPTION_HIDDEN, "print this help", -1 },
// We support --usage as a synonym for --help because argp's
// hardcoded error message for unknown options mentions it.
{ "usage", OPT_HELP, nullptr, OPTION_HIDDEN, nullptr, -1 },
{ nullptr, 0, nullptr, 0, nullptr, 0 }
};