[all-commits] [llvm/llvm-project] b2ea9e: [CommandLine] Do not print empty categories with '...

Igor Kudrin via All-commits all-commits at lists.llvm.org
Mon Jan 8 14:03:30 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b2ea9ec7fcf37ca01979c11c5b2b1cab0e1ae212
      https://github.com/llvm/llvm-project/commit/b2ea9ec7fcf37ca01979c11c5b2b1cab0e1ae212
  Author: Igor Kudrin <ikudrin at accesssoftek.com>
  Date:   2024-01-09 (Tue, 09 Jan 2024)

  Changed paths:
    M llvm/docs/CommandLine.rst
    M llvm/lib/Support/CommandLine.cpp
    M llvm/test/tools/llvm-debuginfo-analyzer/cmdline.test
    M llvm/unittests/Support/CommandLineTest.cpp

  Log Message:
  -----------
  [CommandLine] Do not print empty categories with '--help-hidden' (#77043)

If a category has no options associated with it, the `--help-hidden`
command still shows that category with the annotation "This option
category has no options", and this is how it was implemented from the
beginning when the categories were introduced, see commit 0537a98878. A
feature to hide unrelated options was added later, in
https://reviews.llvm.org/D7100. Now, if a tool needs to hide unrelated
options that are associated with categories, leaving some of them empty,
those categories will still be visible on the `--help-hidden` output,
even if they have no use for the tool; see the changes in
`llvm/test/tools/llvm-debuginfo-analyzer/cmdline.test` for an example.

The patch ensures that only categories with options are shown on both
main and hidden help output.




More information about the All-commits mailing list