Closed casperdcl closed 3 years ago
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 argparse
is quite flexible and supports all.
I just realized that the comments I meant to leave here, I accidentally left on issue #37. Regardless, the details are in pull request #38 and I believe they go a long way in fixing this issue.
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
(#15)Note that
shtab
'szsh
completions by comparison work fine (partly due to the fact thatzsh
itself offers more native completion features).