Add --no-added-binaries to abipkgdiff

* tools/abipkgdiff.cc (options::show_added_binaries): New data
	member.
	(options::options): Initialize it.
	(display_usage): Add a help string for --no-added-binaries.
	(parse_command_line): Parse the new --no-added-binaries option.
	(compare): Do not show added binaries if the user doesn't want to.
	* doc/manuals/abipkgdiff.rst: Document the new --no-added-binaries
	option.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
This commit is contained in:
Dodji Seketeli 2015-07-21 14:15:33 +02:00
parent 96af1baf13
commit b638309e48
2 changed files with 18 additions and 2 deletions

View File

@ -59,6 +59,17 @@ Options
change is a change that has been displayed elsewhere in a given
report.
* ``--no-added-binaries``
Do not show the list of binaries that got added to the second
package.
Please note that the presence of such added binaries is not
considered like an ABI change by this tool; as such, it doesn't
have any impact on the exit code of the tool. It does only have
an informational value. Removed binaries are, however, considered
as an ABI change.
* ``--suppressions | --suppr`` <*path-to-suppressions*>
Use a :ref:`suppression specification <suppr_spec_label>` file

View File

@ -96,13 +96,15 @@ struct options
string debug_package2;
bool compare_dso_only;
bool show_redundant_changes;
bool show_added_binaries;
vector<string> suppression_paths;
options()
: display_usage(),
missing_operand(),
compare_dso_only(),
show_redundant_changes()
show_redundant_changes(),
show_added_binaries(true)
{}
};
@ -241,6 +243,7 @@ display_usage(const string& prog_name, ostream& out)
<< " --suppressions|--suppr <path> specify supression specification path\n"
<< " --dso-only pompare shared libraries only\n"
<< " --redundant display redundant changes\n"
<< " --no-added-binaries do not display added binaries\n"
<< " --verbose emit verbose progress messages\n"
<< " --help display help message\n";
}
@ -687,7 +690,7 @@ compare(package& first_package,
cout << " " << *it << "\n";
}
if (diff.added_binaries.size())
if (opts.show_added_binaries && diff.added_binaries.size())
{
cout << "Added binaries:\n";
for (vector<string>::iterator it = diff.added_binaries.begin();
@ -773,6 +776,8 @@ parse_command_line(int argc, char* argv[], options& opts)
opts.compare_dso_only = true;
else if (!strcmp(argv[i], "--redundant"))
opts.show_redundant_changes = true;
else if (!strcmp(argv[i], "--no-added-binaries"))
opts.show_added_binaries = false;
else if (!strcmp(argv[i], "--verbose"))
verbose = true;
else if (!strcmp(argv[i], "--suppressions")