[applied] abilint: Alphabetically sort programs options

Message ID 87h6l2nf33.fsf@redhat.com
State New
Headers
Series [applied] abilint: Alphabetically sort programs options |

Commit Message

Dodji Seketeli Dec. 1, 2023, 2:59 p.m. UTC
  Hello,

It's a mess to find an option you are looking for both in the manual
or when doing abilint --help.  So how about sorting the options of the
various libabigail programs, starting from abilint?  Here we go.

	* doc/manuals/abilint.rst: Alphabetically sort options in the
	manual.
	* tools/abilint.cc (display_usage): Likewise for the help strings.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
Applied to master.
---
 doc/manuals/abilint.rst | 48 +++++++++++++++++++++++++----------------
 tools/abilint.cc        | 22 +++++++++----------
 2 files changed, 41 insertions(+), 29 deletions(-)
  

Patch

diff --git a/doc/manuals/abilint.rst b/doc/manuals/abilint.rst
index 594dd4c2..5fac4477 100644
--- a/doc/manuals/abilint.rst
+++ b/doc/manuals/abilint.rst
@@ -34,13 +34,12 @@  Options
     or even ELF symbols.  The purpose is to make the ABIXML output
     more human-readable for debugging or documenting purposes.
 
-  * ``--help``
 
-    Display a short help message and exits.
+  * ``--ctf``
 
-  * `--version | -v`
+    Extract ABI information from CTF debug information, if present in
+    the given object.
 
-    Display the version of the program and exit.
 
   * ``--debug-info-dir`` <*path*>
 
@@ -57,17 +56,39 @@  Options
     information installed by your system's package manager because
     then ``abidiff`` knows where to find it.
 
+
   * ``--diff``
 
     For XML inputs, perform a text diff between the input and the
     memory model saved back to disk.  This can help to spot issues in
     the handling of the XML format by the underlying Libabigail library.
 
+
+  * ``--header-file | --hf`` <header-file-path>
+
+    Specifies where to find one of the public headers of the abi file
+    that the tool has to consider.  The tool will thus filter out
+    types that are not defined in public headers.
+
+
+  * ``--headers-dir | --hd`` <headers-directory-path-1>
+
+    Specifies where to find the public headers of the first shared
+    library that the tool has to consider.  The tool will thus filter
+    out types that are not defined in public headers.
+
+
+  * ``--help``
+
+    Display a short help message and exits.
+
+
   * ``--noout``
 
     Do not display anything on standard output.  The return code of
     the command is the only way to know if the command succeeded.
 
+
   * ``--suppressions | suppr`` <*path-to-suppression-specifications-file*>
 
     Use a :ref:`suppression specification <suppr_spec_label>` file
@@ -77,30 +98,21 @@  Options
     taken into account.  ABI artifacts matched by the suppression
     specifications are suppressed from the output of this tool.
 
-  * ``--headers-dir | --hd`` <headers-directory-path-1>
-
-    Specifies where to find the public headers of the first shared
-    library that the tool has to consider.  The tool will thus filter
-    out types that are not defined in public headers.
-
-  * ``--header-file | --hf`` <header-file-path>
-
-    Specifies where to find one of the public headers of the abi file
-    that the tool has to consider.  The tool will thus filter out
-    types that are not defined in public headers.
 
   * ``--stdin | --``
 
     Read the input content from standard input.
 
+
   * ``--tu``
 
     Expect the input XML to represent a single translation unit.
 
-  * ``--ctf``
 
-    Extract ABI information from CTF debug information, if present in
-    the given object.
+  * `--version | -v`
+
+    Display the version of the program and exit.
+
 
 .. _ELF: http://en.wikipedia.org/wiki/Executable_and_Linkable_Format
 .. _DWARF: http://www.dwarfstd.org
diff --git a/tools/abilint.cc b/tools/abilint.cc
index 9c6ed897..40fe6f37 100644
--- a/tools/abilint.cc
+++ b/tools/abilint.cc
@@ -485,25 +485,25 @@  display_usage(const string& prog_name, ostream& out)
   emit_prefix(prog_name, out)
     << "usage: " << prog_name << " [options] [<abi-file1>]\n"
     << " where options can be:\n"
-    << "  --help  display this message\n"
-    << "  --version|-v  display program version information and exit\n"
+    << "  --annotate  annotate the ABI artifacts emitted in the output\n"
+#ifdef WITH_CTF
+    << "  --ctf use CTF instead of DWARF in ELF files\n"
+#endif
     << "  --debug-info-dir <path> the path under which to look for "
     "debug info for the elf <abi-file>\n"
-    << "  --headers-dir|--hd <path> the path to headers of the elf file\n"
-    << "  --header-file|--hf <path> the path to one header of the elf file\n"
-    << "  --suppressions|--suppr <path> specify a suppression file\n"
     << "  --diff  for xml inputs, perform a text diff between "
     "the input and the memory model saved back to disk\n"
+    << "  --header-file|--hf <path> the path to one header of the elf file\n"
+    << "  --headers-dir|--hd <path> the path to headers of the elf file\n"
+    << "  --help  display this message\n"
     << "  --noout  do not display anything on stdout\n"
-    << "  --annotate  annotate the ABI artifacts emitted in the output\n"
-    << "  --stdin  read abi-file content from stdin\n"
-    << "  --tu  expect a single translation unit file\n"
-#ifdef WITH_CTF
-    << "  --ctf use CTF instead of DWARF in ELF files\n"
-#endif
 #ifdef WITH_SHOW_TYPE_USE_IN_ABILINT
     << "  --show-type-use <type-id>  show how a type is used from the abixml file\n"
 #endif
+    << "  --stdin  read abi-file content from stdin\n"
+    << "  --suppressions|--suppr <path> specify a suppression file\n"
+    << "  --tu  expect a single translation unit file\n"
+    << "  --version|-v  display program version information and exit\n"
     ;
 }