-
Notifications
You must be signed in to change notification settings - Fork 37
Description
Hey, thanks for creating this!
I wanted to start using it in a CLI project of my own, but before adoption, I am facing a usability question, which I was not able to find an immediate answer to.
Does shtab
support the "one ArgumentParser
per command class" use case?
Briefly explained, in this model, each CLI command inherits from a Command
base class, which defines a parser for that specific argument only. Resolving the subcommand can then happen in an argument parser for the bare command. An example of a project using this is pip
, with the base command implemented here.
Whereas for dvc
, each command gets a subparser added to the single main dvc
command parser, and the completion is added to the base parser, if I understood correctly.
The completion I am looking for would then do, say for two available subcommands bb and bbcc
,
prog b<TAB>
# bb bbcc
Is this possible to do in current shtab
if both of my bb
and bbcc
subcommands have their own argument parsers, as well as the base prog
parser?
Thanks!