[Lldb-commits] [PATCH] D80165: [lldb/Driver] Fix handling on positional arguments

Jim Ingham via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu May 21 10:15:41 PDT 2020


jingham added a comment.

In D80165#2048458 <https://reviews.llvm.org/D80165#2048458>, @labath wrote:

> In D80165#2047241 <https://reviews.llvm.org/D80165#2047241>, @jingham wrote:
>
> > In D80165#2045882 <https://reviews.llvm.org/D80165#2045882>, @labath wrote:
> >
> > > In D80165#2044509 <https://reviews.llvm.org/D80165#2044509>, @jingham wrote:
> > >
> > > > We should make sure if we do exit that we don't output any other text that would obscure the error message.  It should be easy to spot the error both so you can easily fix it and to prevent you from typing lldb commands into your shell.  If libOption had a "nearest option name to the one you typed" facility that would be useful in this case as well.
> > >
> > >
> > > That facility exists. Clang uses it for command-line "fix-its". I am not sure what it takes to make use of it.
> >
> >
> > Jonas said this wasn't part of libOption, but was done by hand in clang.
>
>
> Oh, that's too bad.
>
> > 
> > 
> >> 
> >> 
> >>> Does anybody remember what gdb does when you mistype a command-line option?  We're not at all required to model their behavior, but it would be interesting to consider.
> >> 
> >>   $ gdb -foobar
> >>   gdb: unrecognized option '-foobar'
> >>   Use `gdb --help' for a complete list of options.
> > 
> > You omitted the bit of text that would show whether it quit or not...
>
> It did quit.  With exit code 1. :)


Great, then we all agree that exiting is the right thing to do!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D80165/new/

https://reviews.llvm.org/D80165





More information about the lldb-commits mailing list