[PATCH] D35476: [libOption] - Add flag allowing to print options aliases in help text.

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 25 11:07:10 PDT 2017


ruiu accepted this revision.
ruiu added a comment.
This revision is now accepted and ready to land.

LGTM



================
Comment at: include/llvm/Option/OptTable.h:194-197
+  /// \param ShowAllAliases - If true then aliases without explicitly set
+  ///                         HelpText will be rendered, inheriting it from
+  ///                         aliased option.
+  void PrintHelp(raw_ostream &OS, const char *Name, const char *Title,
----------------
If true, display all options including aliases that don't have help texts. By default, we display only options that are not hidden and have help texts.


================
Comment at: lib/Option/OptTable.cpp:478-481
+    // Aliases usually do not have help text set explicitly. If we want to show
+    // such aliases in help, we use associated aliased option help text value.
+    // If both alias and aliased option has no text, that proably means option
+    // is ignored.
----------------
If an alias doesn't have a help text, show a help text for the aliased option instead.


https://reviews.llvm.org/D35476





More information about the llvm-commits mailing list