Add a -h option shortcut to abidiff

Added a -h shortcut for --help to the abidiff program.n

	* tools/abidiff.cc (display_usage): Add documentation for the new
	switch.
	(parse_command_line): Parse the -h option.
	* doc/manuals/abidiff.rst: Update the manual.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
This commit is contained in:
Dodji Seketeli 2015-08-13 23:07:24 +02:00
parent da870f3598
commit 71acc72064
2 changed files with 4 additions and 3 deletions

View File

@ -28,7 +28,7 @@ Invocation
Options
=======
* ``--help``
* ``--help | -h``
Display a short help about the command and exit.

View File

@ -138,7 +138,7 @@ display_usage(const string& prog_name, ostream& out)
"(this is the default)\n"
<< " --dump-diff-tree emit a debug dump of the internal diff tree to "
"the error output stream\n"
<< " --help display this message\n";
<< " --help|-h display this message\n";
}
/// Parse the command line and set the options accordingly.
@ -203,7 +203,8 @@ parse_command_line(int argc, char* argv[], options& opts)
opts.show_stats_only = true;
else if (!strcmp(argv[i], "--symtabs"))
opts.show_symtabs = true;
else if (!strcmp(argv[i], "--help"))
else if (!strcmp(argv[i], "--help")
|| !strcmp(argv[i], "-h"))
{
opts.display_usage = true;
return true;