Skip to content
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

ctx.invoked_subcommand is always None #205

Closed
untitaker opened this issue Aug 21, 2014 · 7 comments
Closed

ctx.invoked_subcommand is always None #205

untitaker opened this issue Aug 21, 2014 · 7 comments

Comments

@untitaker
Copy link
Contributor

The example from http://click.pocoo.org/commands/#group-invocation-without-command:

$ python test.py sync
I was invoked without subcommand
The subcommand
untitaker added a commit to pimutils/khal that referenced this issue Aug 21, 2014
Also remove default subcommand feature because of
pallets/click#205
@untitaker
Copy link
Contributor Author

Workaround: For some cases, checking for the truthness of ctx.args is good enough.

untitaker added a commit to pimutils/khal that referenced this issue Aug 21, 2014
Also remove default subcommand feature because of
pallets/click#205
untitaker added a commit to untitaker/click that referenced this issue Aug 21, 2014
untitaker added a commit to untitaker/click that referenced this issue Aug 21, 2014
untitaker added a commit to pimutils/khal that referenced this issue Aug 21, 2014
Also remove default subcommand feature because of
pallets/click#205
untitaker added a commit to untitaker/click that referenced this issue Aug 21, 2014
@mitsuhiko
Copy link
Contributor

This is a stupid situation I brought this into. As far as I can see there is no real way to fix this. I need to think about what I actually want this to do now.

@untitaker
Copy link
Contributor Author

Comments on the PR? I actually tried splitting the operations of handle_subcommand up, but that didn't work well with chained commands.

@mitsuhiko
Copy link
Contributor

While the solution is neat, it causes artifacts because callbacks for instance cannot accept the object yet which causes issues. I much rather remove the invoked_subcommands property again and just provide a "*" for multi invokes.

@mitsuhiko
Copy link
Contributor

Just supporting a single invoked_subcommand is possible because it requires a single lookahead which is okay.

@untitaker
Copy link
Contributor Author

Thanks. Any ETA on 3.2?

@mitsuhiko
Copy link
Contributor

Released as off now.

untitaker added a commit to pimutils/khal that referenced this issue Aug 26, 2014
Also remove default subcommand feature because of
pallets/click#205
untitaker added a commit to pimutils/khal that referenced this issue Aug 26, 2014
Also remove default subcommand feature because of
pallets/click#205
untitaker added a commit to pimutils/khal that referenced this issue Sep 5, 2014
Also remove default subcommand feature because of
pallets/click#205
untitaker added a commit to pimutils/khal that referenced this issue Sep 5, 2014
Also remove default subcommand feature because of
pallets/click#205
untitaker added a commit to pimutils/khal that referenced this issue Sep 5, 2014
Also remove default subcommand feature because of
pallets/click#205
untitaker added a commit to pimutils/khal that referenced this issue Sep 5, 2014
Also remove default subcommand feature because of
pallets/click#205
untitaker added a commit to pimutils/khal that referenced this issue Sep 11, 2014
Also remove default subcommand feature because of
pallets/click#205
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants