When printing the help (most likely triggered by the tool’s option
"--help"), then list also those options, that don’t have a
documentation, i.e. no help text. That makes those options more
discoverable. The user is then able to search online, for example in an
alternate, non-official documentation, for example in the GCC or MSVC
documentaion in case of Clang.
An example of an option without help text is Clang’s option "-static",
which is well established, but couldn’t be found previously in the help
output.
If we want to hide specific options without help text, we should flag
them with llvm::opt::DriverFlag::HelpHidden, instead of relying on them
being hidden, because they have no help text.
With these changes:
$ ./clang.exe --help | wc -l 2451 $ ./clang.exe --help-hidden | wc -l 2556
Without these changes (on commit 2854852f4f0f):
$ ./clang.exe --help | wc -l 1358 $ ./clang.exe --help-hidden | wc -l 1427
IMHO, printing (no help text for the -fno-<option> variant):
on top of:
is of little value. To me this is noise that we should avoid. If both -fbackslash and -fno-backslash are printed, then both should contain "help" text.