[llvm-dev] Short aliases in help text

James Henderson via llvm-dev llvm-dev at lists.llvm.org
Mon Jun 10 10:12:31 PDT 2019

Hi all,

GNU binary tools list both their long and short form aliases in
command-line help text, but by default, LLVM tools using the cl::opt
interface only show the "main" form, which is usually the long-form. It is
possible to override this behaviour, but it is not that common to do so in
many tools. In some tools, there's a mixture of behaviour between the two.
I'd like to propose changing the default behaviour of cl::alias to not hide
the short switch, or even better, find a way to wrap them into a single
help text entry like GNU tools do.

Example GNU nm --help snippet:
-a, --debug-syms       Display debugger-only symbols

Equivalent llvm-nm output:
--debug-syms      - Show all symbols, even debugger only

Example llvm-readelf output:
-l                           - Alias for --program-headers
<lots of other options...>
--program-headers            - Display ELF program headers

These are just some examples. I'm sure there is (was?) a reason that
aliases were hidden by default, but doing so can make it hard for people
who are more familiar with short options, and lead to lots of unnecessary


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190610/c858da46/attachment.html>

More information about the llvm-dev mailing list