-
Notifications
You must be signed in to change notification settings - Fork 345
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(cli): Add autocomplete on integrations, kits, kamelets commands #3902
feat(cli): Add autocomplete on integrations, kits, kamelets commands #3902
Conversation
* kamel get / kamel delete autocompletes on integrations * kamel get kit autocompletes on all kits * kamel delete kit autocompletes on non-platform kits * kamel kamelet delete autocompletes on non-readonly and non-bundled kamelets * kamel describe kamelet autocompletes on all kamelets Closes apache#3628
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice stuff, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thanks!
@gansheer OK, so I didn't notice that the autocompletion functions for
Is this only me? |
The camel-k/pkg/cmd/completion_bash.go Lines 178 to 204 in 5e61ed9
It is why it was never called before, so it is normal it never works on your laptop. For the |
Ah yes, |
I am also using Fedora and both works on bash.
The internal command used to retrieve integrations is : I will create an issue about this "namespace" behavior. I tried some fixes while adding the missing autocompletes without success with the current way of managing autocompletes. |
I spent some time on the namespace problem and managed to make some adaptations that can make use of flag namespace (like For the moment, we could continue the current PR without dealing with the namespace problem if you think it still helps the CLI usability. |
Hmm, namespace doesn't seem to be a problem for me. I use
so the internal command also works fine for me:
Anyway, if it works for you on Fedora, then probably the problem should be specific to my env. I'll look into further why it doesn't work for me.
Yes, please go ahead and file another issue. I also looked at the other commit and it looks good as well. So please submit a pull req with it. In the meantime, I think this pull req is great enough so I'm merging it. |
Fixes #3628
Motivation
Adding some completion on CLI basic commands to improve its usability through bash completion.
Description
The completion uses
kubectl
commands to retrieve the results.kamel get
autocomplete on integrations*
kamel delete
autocomplete on integrations (no modification made)kamel get kit
autocomplete on all kitskamel delete kit
still autocomplete on non-platform kits (no modification made)kamel kamelet delete
autocomplete on non-readonly and non-bundled kamelets (this is the command behavior)kamel describe kamelet
autocomplete on all kameletsPre-existing limit : the completion never use the value of the namespace flag even if it is provided, it always use the kubectl config context namespace. For
kamel -n usernamespace get <TAB>
, completion runskamel get
. None of the completion use the namespace flag.Release Note