From da870f3598588d5989bf901a764f67fb6e6029c8 Mon Sep 17 00:00:00 2001 From: Dodji Seketeli Date: Thu, 13 Aug 2015 17:19:59 +0200 Subject: [PATCH] Add a -h shortcup to abipkgdiff --help * tools/abipkgdiff.cc (display_usage): Document the -h shortcut. (parse_command_line): Parse the -h shortcut to --help. Signed-off-by: Dodji Seketeli --- doc/manuals/abipkgdiff.rst | 2 +- tools/abipkgdiff.cc | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/doc/manuals/abipkgdiff.rst b/doc/manuals/abipkgdiff.rst index 26264ac4..fcc6b0d0 100644 --- a/doc/manuals/abipkgdiff.rst +++ b/doc/manuals/abipkgdiff.rst @@ -32,7 +32,7 @@ Invocation Options ======= - * ``--help`` + * ``--help | -h`` Display a short help about the command and exit. diff --git a/tools/abipkgdiff.cc b/tools/abipkgdiff.cc index bfa03244..913835c3 100644 --- a/tools/abipkgdiff.cc +++ b/tools/abipkgdiff.cc @@ -369,7 +369,7 @@ display_usage(const string& prog_name, ostream& out) << " --no-added-syms do not display added functions or variables\n" << " --no-added-binaries do not display added binaries\n" << " --verbose emit verbose progress messages\n" - << " --help display help message\n"; + << " --help|-h display help message\n"; } /// Extract an RPM package. @@ -945,7 +945,8 @@ parse_command_line(int argc, char* argv[], options& opts) opts.suppression_paths.push_back(argv[j]); ++i; } - else if (!strcmp(argv[i], "--help")) + else if (!strcmp(argv[i], "--help") + || !strcmp(argv[i], "-h")) { opts.display_usage = true; return true;