From d1c2199e087c197ed616cc8ca420572e6e0f88c8 Mon Sep 17 00:00:00 2001 From: Dodji Seketeli Date: Sun, 8 May 2016 12:24:23 +0200 Subject: [PATCH] Add several shortcuts to options for abicompat This patch adds the following convenience command line options shortcuts: --suppr, --appd, --libd1, --libd2 for the following command line options: --suppressions, --app-debug-info-dir, --lib-debug-info-dir1, --lib-debug-info-dir2 The patch also updates the documentation accordingly. * doc/manuals/abicompat.rst: Update documentation. * tools/abicompat.cc (display_usage): Update help strings. (parse_command_line): Add shortcuts --suppr, --appd, --libd1 and --libd2. Signed-off-by: Dodji Seketeli --- doc/manuals/abicompat.rst | 13 ++++++++++--- tools/abicompat.cc | 20 ++++++++++++-------- 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/doc/manuals/abicompat.rst b/doc/manuals/abicompat.rst index 93c6ddf7..acb2ab06 100644 --- a/doc/manuals/abicompat.rst +++ b/doc/manuals/abicompat.rst @@ -44,27 +44,34 @@ Options scripts that wants to compare names of the application and libraries independently of what their directory names are. - * ``--app-debug-info-dir`` + * ``--app-debug-info-dir | --appd`` Set the path to the directory under which the debug information of the application is supposed to be laid out. This is useful for application binaries for which the debug info is in a separate set of files. - * ``--lib-debug-info-dir1`` + * ``--lib-debug-info-dir1 | --libd1`` Set the path to the directory under which the debug information of the first version of the shared library is supposed to be laid out. This is useful for shared library binaries for which the debug info is in a separate set of files. - * ``--lib-debug-info-dir2`` + * ``--lib-debug-info-dir2 | --libd2`` Set the path to the directory under which the debug information of the second version of the shared library is supposed to be laid out. This is useful for shared library binaries for which the debug info is in a separate set of files. + * ``--suppressions | --suppr`` <*path-to-suppressions*> + + Use a :ref:`suppression specification ` file + located at *path-to-suppressions*. Note that this option can + appear multiple times on the command line; all the suppression + specification files are then taken into account. + * ``--no-show-locs`` Do not show information about where in the *second shared library* diff --git a/tools/abicompat.cc b/tools/abicompat.cc index 73562c1b..0e444553 100644 --- a/tools/abicompat.cc +++ b/tools/abicompat.cc @@ -113,13 +113,13 @@ display_usage(const string& prog_name, ostream& out) "undefined symbols of the application\n" << " --show-base-names|b in the report, only show the base names " " of the files; not the full paths\n" - << " --app-debug-info-dir set the path " + << " --app-debug-info-dir|--appd set the path " "to the debug information directory for the application\n" - << " --lib-debug-info-dir1 set the path " + << " --lib-debug-info-dir1|--libd1 set the path " "to the debug information directory for the first library\n" - << " --lib-debug-info-dir2 set the path " + << " --lib-debug-info-dir2|--libd2 set the path " "to the debug information directory for the second library\n" - << "--suppressions specify a suppression file\n" + << "--suppressions|--suppr specify a suppression file\n" << "--no-redundant do not display redundant changes\n" << "--no-show-locs do now show location information\n" << "--redundant display redundant changes (this is the default)\n" @@ -159,7 +159,8 @@ parse_command_line(int argc, char* argv[], options& opts) else if (!strcmp(argv[i], "--show-base-names") || !strcmp(argv[i], "-b")) opts.show_base_names = true; - else if (!strcmp(argv[i], "--app-debug-info-dir")) + else if (!strcmp(argv[i], "--app-debug-info-dir") + || !strcmp(argv[i], "--appd")) { if (argc <= i + 1 || argv[i + 1][0] == '-') @@ -170,7 +171,8 @@ parse_command_line(int argc, char* argv[], options& opts) abigail::tools_utils::make_path_absolute(argv[i + 1]); ++i; } - else if (!strcmp(argv[i], "--lib-debug-info-dir1")) + else if (!strcmp(argv[i], "--lib-debug-info-dir1") + || !strcmp(argv[i], "--libd1")) { if (argc <= i + 1 || argv[i + 1][0] == '-') @@ -181,7 +183,8 @@ parse_command_line(int argc, char* argv[], options& opts) abigail::tools_utils::make_path_absolute(argv[i + 1]); ++i; } - else if (!strcmp(argv[i], "--lib-debug-info-dir2")) + else if (!strcmp(argv[i], "--lib-debug-info-dir2") + || !strcmp(argv[i], "--libd2")) { if (argc <= i + 1 || argv[i + 1][0] == '-') @@ -192,7 +195,8 @@ parse_command_line(int argc, char* argv[], options& opts) abigail::tools_utils::make_path_absolute(argv[i + 1]); ++i; } - else if (!strcmp(argv[i], "--suppressions")) + else if (!strcmp(argv[i], "--suppressions") + || !strcmp(argv[i], "--suppr")) { int j = i + 1; if (j >= argc)