OSDN Git Service

[lldb/Driver] Fix handling on positional arguments
authorJonas Devlieghere <jonas@devlieghere.com>
Tue, 19 May 2020 01:10:53 +0000 (18:10 -0700)
committerJonas Devlieghere <jonas@devlieghere.com>
Tue, 19 May 2020 01:52:18 +0000 (18:52 -0700)
commit82093e8fb7d65486ff450d33bf386aabd0d194f7
treeeae3ba4e6c9d0486db804e4eff7e40800e10610c
parent9971839942f5e2236ccbebfdb72b509426c06649
[lldb/Driver] Fix handling on positional arguments

Before the transition to libOption it was possible to specify arguments
for the inferior without -- as long as they didn't start with a dash.

For example, the following invocations should all behave the same:

  $ lldb inferior inferior-arg
  $ lldb inferior -- inferior-arg
  $ lldb -- inferior inferior-arg

This patch fixes that behavior, documents it and adds a test to cover
the different combinations.

Differential revision: https://reviews.llvm.org/D80165
lldb/docs/man/lldb.rst
lldb/test/Shell/Driver/TestNoUseColor.test
lldb/test/Shell/Driver/TestPositionalArgs.test [new file with mode: 0644]
lldb/tools/driver/Driver.cpp