I think there's a lot of value in having lldb's help output and cl syntax match all of the other llvm tools that people are already familiar with.  Simplicity through consistency.  So lgtm<br><div class="gmail_quote"><div dir="ltr">On Tue, Mar 1, 2016 at 4:22 AM Pavel Labath <<a href="mailto:labath@google.com">labath@google.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">labath added a comment.<br>
<br>
In <a href="http://reviews.llvm.org/D17724#364450" rel="noreferrer" target="_blank">http://reviews.llvm.org/D17724#364450</a>, @clayborg wrote:<br>
<br>
> As long as both long and short options are still supported? Can you still type any of:<br>
><br>
> - --arch=x86_64<br>
> - --arch x86_64<br>
> - -arch=x86_64<br>
> - -arch x86_64<br>
> - -ax86_64<br>
> - -a x86_64<br>
<br>
<br>
All the variants work (including -a=x86_64) **except** the "-ax86_64" version. Not sure if it's that important to maintain this one.<br>
<br>
> Are we able to track which options can be used with other options with the llvm solution? I didn't look too close. There were bits in the old option definitions which defined with options could be specified with which other options.<br>
<br>
<br>
These bits were there, but they weren't used for any verification purposes, only for formatting the `--help` output, which I did not find altogether useful anyway, as it has too many options and variants (some of which are wrong).<br>
<br>
  lldb -h<br>
  lldb -v [[--] <PROGRAM-ARG-1> [<PROGRAM_ARG-2> ...]]<br>
  lldb -a <arch> -f <filename> [-c <filename>] [-s <filename>] [-o <none>] [-S <filename>] [-O <none>] [-k <none>] [-K <filename>] [-Q] [-b] [-e] [-x] [-X] [-l <script-language>] [-d] [[--] <PROGRAM-ARG-1> [<PROGRAM_ARG-2> ...]]<br>
  lldb -n <process-name> -w [-s <filename>] [-o <none>] [-S <filename>] [-O <none>] [-k <none>] [-K <filename>] [-Q] [-b] [-e] [-x] [-X] [-l <script-language>] [-d]<br>
  lldb -p <pid> [-s <filename>] [-o <none>] [-S <filename>] [-O <none>] [-k <none>] [-K <filename>] [-Q] [-b] [-e] [-x] [-X] [-l <script-language>] [-d]<br>
  lldb -P<br>
  lldb -r [<none>] -R <none><br>
<br>
We can't get llvm to produce this kind of output for us, but we can use "option categories". By default, we have "general" and "generic" categories ( :P ), but I was thinking about adding a "repl" category (for --repl, --repl-language) and a "scripting category" (all --source and --one-line options, --batch, etc.). IMHO, this would help the output readability more than the previous "option sets" variant.<br>
<br>
This would not help the enforcement of option combinations in a declarative manner, but as we have introspection, it wouldn't be too hard to express "no option from the 'repl' category can be used with other options" with a bit of code.<br>
<br>
> The other thing that might throw people for a loop is if llvm doesn't support this style:<br>
<br>
><br>
<br>
> % lldb /bin/ls --arch=x86_64 -- -lAF<br>
<br>
<br>
This works as expected.<br>
<br>
So, yes, there are tiny regressions, but these are not important IMO, and I think this makes a nice code simplification. However, if I'm not interested in shoving this in if people don't approve, so... let me know what you think<br>
<br>
<br>
<a href="http://reviews.llvm.org/D17724" rel="noreferrer" target="_blank">http://reviews.llvm.org/D17724</a><br>
<br>
<br>
<br>
</blockquote></div>