[PATCH] Added --help-hidden-all option which prints all known command-line options with or without HelpText specified.Depends on D7361 in llvm
Artem Belevich
tra at google.com
Mon Feb 2 15:32:56 PST 2015
Hi echristo,
Added --help-hidden-all option
http://reviews.llvm.org/D7362
Files:
include/clang/Driver/Driver.h
include/clang/Driver/Options.td
lib/Driver/Driver.cpp
Index: include/clang/Driver/Driver.h
===================================================================
--- include/clang/Driver/Driver.h
+++ include/clang/Driver/Driver.h
@@ -316,7 +316,8 @@
/// PrintHelp - Print the help text.
///
/// \param ShowHidden - Show hidden options.
- void PrintHelp(bool ShowHidden) const;
+ /// \param ShowHidden - Show hidden options without help string, too.
+ void PrintHelp(bool ShowHidden, bool ShowUndocumented) const;
/// PrintVersion - Print the driver version.
void PrintVersion(const Compilation &C, raw_ostream &OS) const;
Index: include/clang/Driver/Options.td
===================================================================
--- include/clang/Driver/Options.td
+++ include/clang/Driver/Options.td
@@ -1590,6 +1590,7 @@
def _force_link_EQ : Joined<["--"], "force-link=">, Alias<u>;
def _force_link : Separate<["--"], "force-link">, Alias<u>;
def _help_hidden : Flag<["--"], "help-hidden">;
+def _help_hidden_all : Flag<["--"], "help-hidden-all">;
def _imacros_EQ : Joined<["--"], "imacros=">, Alias<imacros>;
def _include_barrier : Flag<["--"], "include-barrier">, Alias<I_>;
def _include_directory_after_EQ : Joined<["--"], "include-directory-after=">, Alias<idirafter>;
Index: lib/Driver/Driver.cpp
===================================================================
--- lib/Driver/Driver.cpp
+++ lib/Driver/Driver.cpp
@@ -643,7 +643,7 @@
return 0;
}
-void Driver::PrintHelp(bool ShowHidden) const {
+void Driver::PrintHelp(bool ShowHidden, bool ShowUndocumented) const {
unsigned IncludedFlagsBitmask;
unsigned ExcludedFlagsBitmask;
std::tie(IncludedFlagsBitmask, ExcludedFlagsBitmask) =
@@ -654,7 +654,8 @@
ExcludedFlagsBitmask |= HelpHidden;
getOpts().PrintHelp(llvm::outs(), Name.c_str(), DriverTitle.c_str(),
- IncludedFlagsBitmask, ExcludedFlagsBitmask);
+ IncludedFlagsBitmask, ExcludedFlagsBitmask,
+ ShowUndocumented);
}
void Driver::PrintVersion(const Compilation &C, raw_ostream &OS) const {
@@ -709,8 +710,11 @@
}
if (C.getArgs().hasArg(options::OPT_help) ||
- C.getArgs().hasArg(options::OPT__help_hidden)) {
- PrintHelp(C.getArgs().hasArg(options::OPT__help_hidden));
+ C.getArgs().hasArg(options::OPT__help_hidden) ||
+ C.getArgs().hasArg(options::OPT__help_hidden_all)) {
+ PrintHelp(C.getArgs().hasArg(options::OPT__help_hidden) ||
+ C.getArgs().hasArg(options::OPT__help_hidden_all),
+ C.getArgs().hasArg(options::OPT__help_hidden_all));
return false;
}
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D7362.19196.patch
Type: text/x-patch
Size: 2607 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150202/3750f4d3/attachment.bin>
More information about the cfe-commits
mailing list