This is an archive of the discontinued LLVM Phabricator instance.

[lldb] Add description to option completions.
ClosedPublic

Authored by teemperor on Sep 2 2019, 1:05 AM.

Details

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.

Diff Detail

Repository
rL LLVM

Event Timeline

teemperor created this revision.Sep 2 2019, 1:05 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 2 2019, 1:05 AM
labath accepted this revision.Sep 2 2019, 1:17 AM
labath added a subscriber: labath.

Sounds like a good idea.

I noticed that you have three tests, but are changing four places in the code. Looks like you're probably missing one of them. By the looks of things, it's probably the ambiguous long option case (--ambig<TAB>)..

This revision is now accepted and ready to land.Sep 2 2019, 1:17 AM

Good catch, extended the test to also test the ambiguous options.

This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptSep 2 2019, 1:34 AM