<div dir="ltr">Heavy +1 in favor of changing --help so it automatically combines alias+flag together. Perhaps that's one of the reasons aliases are hidden by default; so they don't clutter --help. If aliases are provided w/ their command, there's very little added clutter.<div><br></div><div>--help lists "-a, --debug-syms" but man pages list it as "[-a|--debug-syms]". I think either (or something else entirely) is fine.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jun 10, 2019 at 10:12 AM James Henderson via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hi all,</div><div><br></div><div>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.</div><div><br></div><div>Example GNU nm --help snippet:</div><div><span style="font-family:"courier new",monospace">-a, --debug-syms       Display debugger-only symbols</span></div><div><br></div><div>Equivalent llvm-nm output:</div><div><span style="font-family:"courier new",monospace">--debug-syms      - Show all symbols, even debugger only</span></div><div><br></div><div>Example llvm-readelf output:</div><div><span style="font-family:"courier new",monospace">-l                           - Alias for --program-headers</span></div><div><span style="font-family:"courier new",monospace"><lots of other options...><br></span></div><div><span style="font-family:"courier new",monospace">--program-headers            - Display ELF program headers</span></div><div><span style="font-family:"courier new",monospace"><br></span></div><div><span style="font-family:"courier new",monospace"><font face="arial,sans-serif">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 typing.</font></span></div><div><span style="font-family:"courier new",monospace"><font face="arial,sans-serif"><br></font></span></div><div><span style="font-family:"courier new",monospace"><font face="arial,sans-serif">Thoughts?</font></span></div><div><span style="font-family:"courier new",monospace"><font face="arial,sans-serif"><br></font></span></div><div><span style="font-family:"courier new",monospace"><font face="arial,sans-serif">James</font></span><br></div></div>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div>