Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

8
  • 2
    Awesome, I was afraid it wouldn't be possible. Commented Nov 20, 2010 at 17:10
  • Note this code has some issues. See my answer for their explanation and resolution. Commented Sep 15, 2016 at 13:06
  • Note: I was using this technique for another command, and I had to use complete -o default -F ... instead of complete -F ... to get things like filename auto-completion working correctly when passing args (Bash 4.3.46). Commented Dec 19, 2016 at 14:39
  • I am struggling to get this working for kubectl. Here is what I am trying: alias ks=kubectl\ --context=staging; make-completion-wrapper __start_kubectl _ks kubectl --context=staging; ` complete -F _ks ks; when I type ks g` it correctly completes to ks get but then when i type ks get p I don't get expected completions like 'pods`. Am I doing something wrong? Commented May 8, 2020 at 23:07
  • [update]: I think the underlying problem for me is w kubectl, not the alias... kubectl get p also does not complete as expected. Commented May 8, 2020 at 23:24