-
Notifications
You must be signed in to change notification settings - Fork 34
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
bash: better --optional
and <positional>
support
#11
Comments
In order to better understand this problem, I have a few questions:
It would be nice to operate under these assumptions, but with my limited experience with command line interfaces, I am unsure of just how reasonable they are. Any input would be greatly appreciated. |
Actually, scratch that last comment. Looking through the argparse documentation and running some tests, it looks like most of those assumptions are easily broken... I may have a solution though. Stay tuned. |
Yup |
fixed by #38 |
Bad
bash
behaviour:add_argument("--optional")
add_argument("--optional").complete = shtab.FILE
add_argument("positional")
<pos1> <foo> <bar>
is indistinguishable from<bar> <pos1> <foo>
)add_argument("positional1", choices=["one", "two"]); add_argument("positional2")
one
andtwo
as subcommands, so won't completepositional2
(fix AssertionError on valid choices #15)Note that
shtab
'szsh
completions by comparison work fine (partly due to the fact thatzsh
itself offers more native completion features).find a concise neat example bash completion script which implements these featuresmake shtab automatically generate itMore robust bash completions generation #38The text was updated successfully, but these errors were encountered: