You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a sub command or long argument is only partially entered, it would be an ergonomic benefit if clap could infer the right intended sub command or long argument as long as it's unambiguous.
This is currently possible by manually defining aliases for all possible partial matches, but is tedious and would be easy to make mistakes if there are many similar commands.
This is a feature I use heavily with Mercurial, here are some examples.
$ hg bookmark
[snipped output]
$ hg book
[snipped output]
$ hg bo
[snipped output]
$ hg b
hg: command 'b' is ambiguous:
backout bisect blame bookmarks branch branches bundle
$ hg push
[snipped output]
$ hg pus
[snipped output]
$ hg pu
hg: command 'pu' is ambiguous:
pull purge push
$ hg stat --change master^
[snipped output]
$ hg stat --cha master^
[snipped output]
$ hg stat --ch master^
[snipped output]
$ hg stat --c master^
hg status: option --c not a unique prefix
hg status [OPTION]... [FILE]...
show changed files in the working directory
options ([+] can be repeated):
-A --all show status of all files
-m --modified show only modified files
-a --added show only added files
-r --removed show only removed files
-d --deleted show only deleted (but tracked) files
-c --clean show only files without changes
-u --unknown show only unknown (not tracked) files
-i --ignored show only ignored files
-n --no-status hide status prefix
-C --copies show source of copied files
-0 --print0 end filenames with NUL, for use with xargs
--rev REV [+] show difference from revision
--change REV list the changed files of a revision
-I --include PATTERN [+] include names matching the given patterns
-X --exclude PATTERN [+] exclude names matching the given patterns
-S --subrepos recurse into subrepositories
--mq operate on patch repository
(use 'hg status -h' to show more help)
The text was updated successfully, but these errors were encountered:
I like it! Thanks for filing. I'll have to play around with how exactly I want to add this or how it will interact with the suggestions feature because I don't want misspelled words to get inferred, only shortened unambiguous words.
If a sub command or long argument is only partially entered, it would be an ergonomic benefit if clap could infer the right intended sub command or long argument as long as it's unambiguous.
This is currently possible by manually defining aliases for all possible partial matches, but is tedious and would be easy to make mistakes if there are many similar commands.
This is a feature I use heavily with Mercurial, here are some examples.
The text was updated successfully, but these errors were encountered: