[llvm] b7924d6 - [dsymutil] Make sure the --help output and man page are consistent

Jonas Devlieghere via llvm-commits llvm-commits at lists.llvm.org
Mon May 18 11:38:44 PDT 2020


Author: Jonas Devlieghere
Date: 2020-05-18T11:38:36-07:00
New Revision: b7924d6525be103b6ffd93c7b9787d4339b3ad61

URL: https://github.com/llvm/llvm-project/commit/b7924d6525be103b6ffd93c7b9787d4339b3ad61
DIFF: https://github.com/llvm/llvm-project/commit/b7924d6525be103b6ffd93c7b9787d4339b3ad61.diff

LOG: [dsymutil] Make sure the --help output and man page are consistent

As suggested by Adrian in D79398.

Added: 
    

Modified: 
    llvm/docs/CommandGuide/dsymutil.rst
    llvm/test/tools/dsymutil/cmdline.test
    llvm/tools/dsymutil/Options.td

Removed: 
    


################################################################################
diff  --git a/llvm/docs/CommandGuide/dsymutil.rst b/llvm/docs/CommandGuide/dsymutil.rst
index 5e0140bf2041..5b7016ced2f5 100644
--- a/llvm/docs/CommandGuide/dsymutil.rst
+++ b/llvm/docs/CommandGuide/dsymutil.rst
@@ -23,7 +23,7 @@ OPTIONS
  Specify the desired type of accelerator table. Valid options are 'Apple',
  'Dwarf' and 'Default'.
 
-.. option:: --arch=<arch>
+.. option:: --arch <arch>
 
  Link DWARF debug information only for specified CPU architecture types.
  Architectures may be specified by name. When using this option, an error will
@@ -37,19 +37,22 @@ OPTIONS
  Dump the *executable*'s debug-map (the list of the object files containing the
  debug information) in YAML format and exit. Not DWARF link will take place.
 
-.. option:: -f, --flat
+.. option:: --flat, -f
 
  Produce a flat dSYM file. A ``.dwarf`` extension will be appended to the
  executable name unless the output file is specified using the ``-o`` option.
 
-.. option:: -h, --help
+.. option:: --help, -h
 
  Print this help output.
 
-.. option:: -j <n>, --num-threads=<n>
+.. option:: --minimize, -z
 
- Specifies the maximum number (``n``) of simultaneous threads to use when
- linking multiple architectures.
+ When used when creating a dSYM file, this option will suppress the emission of
+ the .debug_inlines, .debug_pubnames, and .debug_pubtypes sections since
+ dsymutil currently has better equivalents: .apple_names and .apple_types. When
+ used in conjunction with ``--update`` option, this option will cause redundant
+ accelerator tables to be removed.
 
 .. option:: --no-odr
 
@@ -63,17 +66,22 @@ OPTIONS
 
  Don't check the timestamp for swiftmodule files.
 
-.. option:: --object-prefix-map=<prefix=remapped>
+.. option:: --num-threads <threads>, -j <threads>
+
+ Specifies the maximum number (``n``) of simultaneous threads to use when
+ linking multiple architectures.
+
+.. option:: --object-prefix-map <prefix=remapped>
 
  Remap object file paths (but no source paths) before processing.  Use
  this for Clang objects where the module cache location was remapped using
  ``-fdebug-prefix-map``; to help dsymutil find the Clang module cache.
 
-.. option:: --oso-prepend-path=<path>
+.. option:: --oso-prepend-path <path>
 
  Specifies a ``path`` to prepend to all debug symbol object file paths.
 
-.. option:: -o <filename>, --out <filename>
+.. option:: --out <filename>, -o <filename>
 
  Specifies an alternate ``path`` to place the dSYM bundle. The default dSYM
  bundle path is created by appending ``.dSYM`` to the executable name.
@@ -139,14 +147,6 @@ OPTIONS
 
  Treat *executable* as a YAML debug-map rather than an executable.
 
-.. option:: -z, --minimize
-
- When used when creating a dSYM file, this option will suppress the emission of
- the .debug_inlines, .debug_pubnames, and .debug_pubtypes sections since
- dsymutil currently has better equivalents: .apple_names and .apple_types. When
- used in conjunction with ``--update`` option, this option will cause redundant
- accelerator tables to be removed.
-
 EXIT STATUS
 -----------
 

diff  --git a/llvm/test/tools/dsymutil/cmdline.test b/llvm/test/tools/dsymutil/cmdline.test
index c1347ead0565..29f6e70f0130 100644
--- a/llvm/test/tools/dsymutil/cmdline.test
+++ b/llvm/test/tools/dsymutil/cmdline.test
@@ -1,32 +1,36 @@
-RUN: dsymutil -help 2>&1 | FileCheck --check-prefix=HELP %s
+RUN: dsymutil -help 2>&1 | FileCheck --check-prefix=CHECK --check-prefix=HELP %s
+RUN: cat %S/../../../docs/CommandGuide/dsymutil.rst  | FileCheck %s
+
 HELP: OVERVIEW: manipulate archived DWARF debug symbol files.
 HELP: USAGE: {{.*}}dsymutil{{[^ ]*}} [options] <input files>
 HELP-NOT: -reverse-iterate
 HELP: Dsymutil Options:
-HELP: -accelerator
-HELP: -arch <arch>
-HELP: -dump-debug-map
-HELP: -flat
-HELP: -minimize
-HELP: -no-odr
-HELP: -no-output
-HELP: -no-swiftmodule-timestamp
-HELP: -num-threads <threads>
-HELP: -object-prefix-map <prefix=remapped>
-HELP: -oso-prepend-path <path>
-HELP: {{ -o <filename> }}
-HELP: -papertrail
-HELP: -remarks-output-format <format>
-HELP: -remarks-prepend-path <path>
-HELP: -statistics
-HELP: -symbol-map
-HELP: -symtab
-HELP: {{ -S }}
-HELP: -toolchain
-HELP: -update
-HELP: -verbose
-HELP: -verify
-HELP: {{ -y }}
+CHECK: -accelerator
+CHECK: -arch <arch>
+CHECK: -dump-debug-map
+CHECK: -flat
+CHECK: -help
+CHECK: -minimize
+CHECK: -no-odr
+CHECK: -no-output
+CHECK: -no-swiftmodule-timestamp
+CHECK: -num-threads  <threads>
+CHECK: -object-prefix-map <prefix=remapped>
+CHECK: -oso-prepend-path <path>
+CHECK: -out <filename>
+CHECK: {{-o <filename>}}
+CHECK: -papertrail
+CHECK: -remarks-output-format <format>
+CHECK: -remarks-prepend-path <path>
+CHECK: -statistics
+CHECK: -symbol-map
+CHECK: -symtab
+CHECK: {{-S}}
+CHECK: -toolchain
+CHECK: -update
+CHECK: -verbose
+CHECK: -verify
+CHECK: {{-y}}
 HELP-NOT: -reverse-iterate
 
 RUN: dsymutil --version 2>&1 | FileCheck --check-prefix=VERSION %s

diff  --git a/llvm/tools/dsymutil/Options.td b/llvm/tools/dsymutil/Options.td
index 1542a94636bb..bdd11b5c4c1e 100644
--- a/llvm/tools/dsymutil/Options.td
+++ b/llvm/tools/dsymutil/Options.td
@@ -107,6 +107,7 @@ def output: Separate<["-", "--"], "o">,
   HelpText<"Specify the output file. Defaults to <input file>.dwarf">,
   Group<grp_general>;
 def: Separate<["--", "-"], "out">,
+  MetaVarName<"<filename>">,
   Alias<output>,
   HelpText<"Alias for -o">,
   Group<grp_general>;
@@ -159,7 +160,7 @@ def threads: Separate<["--", "-"], "num-threads">,
   HelpText<"Specifies the maximum number of simultaneous threads to use when linking multiple architectures.">,
   Group<grp_general>;
 def: Separate<["-"], "j">,
-  Alias<threads>,
+  MetaVarName<"<threads>">,
   HelpText<"Alias for --num-threads">,
   Group<grp_general>;
 


        


More information about the llvm-commits mailing list