evanlucas / fish-kubectl-completions

kubectl completions for fish shell
MIT License
576 stars 42 forks source link

Completion with kubectl alias #20

Closed jemag closed 5 years ago

jemag commented 5 years ago

I am fairly new to fish, so please excuse me if there is a straightforward way to do this that I am unaware of.

I currently have an alias for kubectl using "k". This was done with:

[k.fish]

function k
  kubectl $argv
end

Is there a way to make the kubectl completion work with this "k" alias?

jemag commented 5 years ago

Works with alias k="kubectl" in config.fish.

I thought it was equivalent to the function given above and would therefore work too.

evanlucas commented 5 years ago

I use abbr kc 'kubectl' and it should handle wrapping the completions. Otherwise, IIRC, there is a --wraps argument that can be passed to the function definition. So like function k --wraps kubectl. Let me know if those don't work! Thanks!

jemag commented 5 years ago

That works! Thanks for the tips, I'm still slowly learning fish

evanlucas commented 5 years ago

Happy to help! I’m going to go ahead and close this, but please don’t hesitate to let me know if you have any other issues :)