Add --d{1,2} shortcut options for --debug-info-dir{1,2} in abidiff

It turned out typing --debug-info-dir{1,2} is a tad cumbersome.  So this
patch adds --d1 and --d2 shortcut for these options.

	* tools/abidiff.cc (display_usage): Add the --d{1,2} to the help
	strings.
	(parse_command_line): Parse the new --d1 and --d2 options.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
This commit is contained in:
Dodji Seketeli 2015-07-08 17:12:27 +02:00
parent a2601a596a
commit f87d179a01
2 changed files with 9 additions and 7 deletions

View File

@ -32,7 +32,7 @@ Options
Display a short help about the command and exit. Display a short help about the command and exit.
* --debug-info-dir1 <*di-path1*> * --debug-info-dir1 | --d1 <*di-path1*>
For cases where the debug information for *first-shared-library* For cases where the debug information for *first-shared-library*
is split out into a separate file, tells ``abidiff`` where to find is split out into a separate file, tells ``abidiff`` where to find
@ -47,7 +47,7 @@ Options
information installed by your system's package manager because information installed by your system's package manager because
then ``abidiff`` knows where to find it. then ``abidiff`` knows where to find it.
* --debug-info-dir2 <*di-path2*> * --debug-info-dir2 | --d2 <*di-path2*>
Like ``--debug-info-dir1``, this options tells ``abidiff`` where Like ``--debug-info-dir1``, this options tells ``abidiff`` where
to find the split debug information for the to find the split debug information for the

View File

@ -107,10 +107,10 @@ struct options
static void static void
display_usage(const string& prog_name, ostream& out) display_usage(const string& prog_name, ostream& out)
{ {
out << "usage: " << prog_name << " [options] [<bi-file1> <bi-file2>]\n" out << "usage: " << prog_name << " [options] [<file1> <file2>]\n"
<< " where options can be:\n" << " where options can be:\n"
<< " --debug-info-dir1 <path> the root for the debug info of bi-file1\n" << " --debug-info-dir1|--d1 <path> the root for the debug info of file1\n"
<< " --debug-info-dir2 <path> the root for the debug info of bi-file2\n" << " --debug-info-dir2|--d2 <path> the root for the debug info of file2\n"
<< " --stat only display the diff stats\n" << " --stat only display the diff stats\n"
<< " --symtabs only display the symbol tables of the corpora\n" << " --symtabs only display the symbol tables of the corpora\n"
<< " --deleted-fns display deleted public functions\n" << " --deleted-fns display deleted public functions\n"
@ -169,7 +169,8 @@ parse_command_line(int argc, char* argv[], options& opts)
else else
return false; return false;
} }
else if (!strcmp(argv[i], "--debug-info-dir1")) else if (!strcmp(argv[i], "--debug-info-dir1")
|| !strcmp(argv[i], "--d1"))
{ {
int j = i + 1; int j = i + 1;
if (j >= argc) if (j >= argc)
@ -183,7 +184,8 @@ parse_command_line(int argc, char* argv[], options& opts)
abigail::tools_utils::make_path_absolute(argv[j]); abigail::tools_utils::make_path_absolute(argv[j]);
++i; ++i;
} }
else if (!strcmp(argv[i], "--debug-info-dir2")) else if (!strcmp(argv[i], "--debug-info-dir2")
|| !strcmp(argv[i], "--d2"))
{ {
int j = i + 1; int j = i + 1;
if (j >= argc) if (j >= argc)