diff options
author | Raphael Isemann <teemperor@gmail.com> | 2019-09-02 08:34:57 +0000 |
---|---|---|
committer | Raphael Isemann <teemperor@gmail.com> | 2019-09-02 08:34:57 +0000 |
commit | 6897a814e66f2a2d7e0bec07d7a553b5020123de (patch) | |
tree | 28ff6bad08d035757fb3c875361f99fe6862cde1 /lldb/packages/Python/lldbsuite/test/functionalities/completion/TestCompletion.py | |
parent | 453ef4e376a13f5ab8d9e2c6019a57101d8409a4 (diff) | |
download | bcm5719-llvm-6897a814e66f2a2d7e0bec07d7a553b5020123de.tar.gz bcm5719-llvm-6897a814e66f2a2d7e0bec07d7a553b5020123de.zip |
[lldb] Add description to option completions.
Summary:
Right now our argument completions are rather cryptic for command options as they only list the letters:
```
(lldb) breakpoint set -
Available completions:
-G
-C
-c
-d
-i
-o
-q
-t
-x
[...]
```
With the new completion API we can easily extend this with the flag description so that it looks like this now:
```
(lldb) breakpoint set -
Available completions:
-G -- The breakpoint will auto-continue after running its commands.
-C -- A command to run when the breakpoint is hit, can be provided more than once, the commands will get run in order left to right.
-c -- The breakpoint stops only if this condition expression evaluates to true.
-d -- Disable the breakpoint.
-i -- Set the number of times this breakpoint is skipped before stopping.
-o -- The breakpoint is deleted the first time it stop causes a stop.
-q -- The breakpoint stops only for threads in the queue whose name is given by this argument.
-t -- The breakpoint stops only for the thread whose TID matches this argument.
-x -- The breakpoint stops only for the thread whose index matches this argument.
```
The same happens with --long-options now.
Reviewers: #lldb, labath
Reviewed By: labath
Subscribers: labath, JDevlieghere, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D67063
llvm-svn: 370628
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/functionalities/completion/TestCompletion.py')
-rw-r--r-- | lldb/packages/Python/lldbsuite/test/functionalities/completion/TestCompletion.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/completion/TestCompletion.py b/lldb/packages/Python/lldbsuite/test/functionalities/completion/TestCompletion.py index ea4a9c1a773..537c447c07a 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/completion/TestCompletion.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/completion/TestCompletion.py @@ -375,6 +375,30 @@ class CommandLineCompletionTestCase(TestBase): self.check_completion_with_desc("comman", []) self.check_completion_with_desc("non-existent-command", []) + def test_completion_description_command_options(self): + """Test descriptions of command options""" + # Short options + self.check_completion_with_desc("breakpoint set -", [ + ["-h", "Set the breakpoint on exception catcH."], + ["-w", "Set the breakpoint on exception throW."] + ]) + + # Long options. + self.check_completion_with_desc("breakpoint set --", [ + ["--on-catch", "Set the breakpoint on exception catcH."], + ["--on-throw", "Set the breakpoint on exception throW."] + ]) + + # Ambiguous long options. + self.check_completion_with_desc("breakpoint set --on-", [ + ["--on-catch", "Set the breakpoint on exception catcH."], + ["--on-throw", "Set the breakpoint on exception throW."] + ]) + + # Unknown long option. + self.check_completion_with_desc("breakpoint set --Z", [ + ]) + @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24489") def test_symbol_name(self): self.build() |