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
Would it be possible to create subcommands in the context of main command that have parsed options?
I think about something like that:
mycli --variant code subcommand
Internally I would like to load different Subcommand depend on --variant option. That variants of subcommands would have different options and parameters.
So just to sum up. My script will load different Subcommand class depends on --variant option thus main command need to parse options first then load apprioprate subcommand class.
This would be trivial if I could build subcommands after the main (top-level) command have been instantiated and then I will have access to its options.
The text was updated successfully, but these errors were encountered:
Would it be possible to create subcommands in the context of main command that have parsed options?
I think about something like that:
mycli --variant code subcommand
Internally I would like to load different
Subcommand
depend on--variant
option. That variants of subcommands would have different options and parameters.So just to sum up. My script will load different
Subcommand
class depends on--variant
option thus main command need to parse options first then load apprioprate subcommand class.Here is a high level pseudo code for that:
This would be trivial if I could build subcommands after the main (top-level) command have been instantiated and then I will have access to its options.
The text was updated successfully, but these errors were encountered: