-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Root with positional argument followed by subcommand with args #610
Comments
Did you ever find a good way to do this? I'm looking to do much the same thing right now. |
@elfchief Nope. Still using the alternative way I mentioned in the end using flags. |
This issue is being marked as stale due to a long period of inactivity |
Due to age and activity I'm going to go ahead and close this. Just as a point of discussion, I'm not sure that requiring I think the core of this is really a duplicate of #726 as well seeing as how you express that you want to invoke |
This is kind of duplicate of #295 but not exactly. I am looking to have both positional args passed to root and also run subcommand at the same time. Both
legacyArgs()
and the newArgs
doesn't seem to let me have this type of syntax. For example, I have 3 environments that have different configs. My root command gets the env as positional arg followed by a subcommand, which is common to all envs but with different configs.eg.
root prod destroy my-python-app
where prod is positional arg of root, destroy is a subcommand of root and my-python-app is arg of destroyAlternative way to do this would be to have flags:
root --env prod destroy my-python-app
but I don't want to keep it so verbose because env is mandatory anyway.The text was updated successfully, but these errors were encountered: