-
Notifications
You must be signed in to change notification settings - Fork 291
Add support for quoted UCM args. #5968
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| scratch/main> debug.tab-complete "vi | ||
| view | ||
| view.global | ||
| ``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't show in the debug output, but the actual completion will add the closing quotes, i.e. the first result would end up as "view"
144e9da to
1964241
Compare
1964241 to
ba8c2ce
Compare
| -- * Parse Arguments | ||
| parseArgs, | ||
| parseArgsQuoted, | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dunno the right module for these; Open to change if anyone cares 🤷🏼♂️
|
@aryairani I looked into preventing numbered arg expansion when quoted, I'd like to do it but it adds a bit more complexity so I think we should merge this one then I can add that in a new PR. EDIT: here |
|
@ChrisPenner I forgot to ask, how do we escape a |
|
@aryairani standard backslash; |
Overview
Allows passing quoted args to ucm commands.
Motivated by the desire to use this for
config.set-authorandannotatefixes #5417
quote-args.mp4
Implementation notes
Interesting/controversial decisions
There is a
completeQuotedWordin Haskeline, but it doesn't provide the line prefix (which we need for determining the command).Plus, writing our own parser means we can be consistent between the line parser and the completion parser.
Test coverage
Added a transcript for completion and a simple unison prog which demos quoted args to
run.Loose ends
runhahaI'm sure we'll find some more tweaks for this in the future, but shouldn't be hard to add those as they come up.