Subcommands #46
Labels
enhancement
New feature or request
help wanted
Extra attention is needed
v1.0
These issues must be resolved before 1.0 release
Support subcommands like e.g.
commit
is a subcommand ofgit
.Example input:
The generated code will look something like this:
Specification parsing code will get
subcmd: HashMap<Ident, Subcommand>
field.Difficult stuff:
Config
, or outside? The advantage of being outside is it can get global config without self-reference but maybe that's not useful as immutable references will most likely be used?clap
does? If there are multiple nested subcommands and mid-commmands don't have any options, then avoiding the struct would lead to easier-to-write code, although harder-to-refactor. Maybe instead haveSubcmdname { config: subcmdname::Config, subcmd: subcmdname::Subcommand }
, then matching code can just ignore empty struct. This obviously implies "outside" for the question about.The text was updated successfully, but these errors were encountered: