-
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
feat(completion): add option to create default command alone #1392
base: main
Are you sure you want to change the base?
Conversation
Thanks for the PR @scop. I now realize that there is value in a However I am not sure of the right approach for the best user experience. Allowing the creation of the And completion itself isn't as smooth as usual because when doing completion of arguments, the But I agree that it probably has more value to have the I just wanted to continue your discussion and see if others had suggestions about this. |
This PR is being marked as stale due to a long period of inactivity |
Still valid |
Sorry about the delay in following up. I agree with the concerns flagged by @marckhouzam, and made an alternative implementation in #1450 that doesn't have those problems. It's not that nice that the completion command is completely hidden, but better than the alternatives I believe. |
A middle ground could be worth considering as well: let the default completion generate the help section in the usage output, but avoid them being offered as completions. Guess that would be somewhat more code though. |
We could also introduce a command like |
I believe this has been replaced by #1450 |
548b27b
to
be2d93c
Compare
be2d93c
to
a27fd0d
Compare
The current implementation of the default completion (and help) commands makes them available only when there are some other commands defined. This rules them out for apps that have no other subcommands, either by design anew, or for historical behavior, even though they would benefit from completions both in the first place, and the convenience of having the default generated.
This adds a new completion option for having the default init happen in those cases. Not that clean in the first place and the variable name is a mouthful, but the functionality would be great to have.
Untested, mainly for discussion purposes, but in absence of something better, I'd be fine with something like this.