Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Composing completions for a wrapper script



Hi, everyone!

I am writing some wrapper functions over existing commands, e.g.

kubectldc() {
  DC="$1"
  shift
  KUBECONFIG="$HOME/.kube/$DC.kubeconfig" kubectl "$@"
}

Kubectl is a well-behaved command, which does have rich completion available. Is it possible to somehow reuse its completion for kubectldc command? As-is the function definition becomes a tradeoff between "using kubectl directly for completion but having to select config manually" and "using the wrapper for automatic config but no completion".



Messages sorted by: Reverse Date, Date, Thread, Author