From 7b580e006a948baa78e28d8dea1f0d000a1852fd Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Sun, 20 May 2018 17:36:24 +0200 Subject: [PATCH] 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. --- bin/common_setup.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bin/common_setup.cc b/bin/common_setup.cc index 39337669a..27a205654 100644 --- a/bin/common_setup.cc +++ b/bin/common_setup.cc @@ -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 } };