-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Shell completion does not support the "no space" format of short flags #1629
Comments
I agree that this would be great. At the moment we reverse engineer the flag parsing code which leads to problems like this. |
Agreed. I was thinking that maybe we can use pflags directly to do the flag parsing. There may be options available in pflag that handle the special cases that completion requires. But I'll have to look into the details of pflag to see what we can do. |
The Cobra project currently lacks enough contributors to adequately respond to all issues. This bot triages issues and PRs according to the following rules:
|
Still valid. |
Should |
The Cobra project currently lacks enough contributors to adequately respond to all issues. This bot triages issues and PRs according to the following rules:
|
To all available namespaces |
Actually, probably not. Currently if we do But if we have Does that make sense? |
Cobra supports a "no space" format for short flags. I had used it before, but I never really paid attention to it in the code base. For example:
Notice the lack of a space between the
-n
flag and theinfra-prometheus
namespace name.In fact, this seems to work when using multiple short flags:
Notice how the
-i
,-t
and-n
short flags are used together, with only the last one requiring an argument, and that that argument does not need to be preceded by a space.Granted that the second example seems unlikely to be used, however the first example seems reasonable (in fact I used it a lot in the past).
Shell completion does not support those "no space" scenarios:
I haven't had time to investigate, but I wanted to at least document the issue.
The text was updated successfully, but these errors were encountered: