complete-alias
complete-alias copied to clipboard
`_complete_alias` with environment variable influencing behavior
There are commands that have different completion depending on an environment variable.
E.g. kubeconfig
(and oc
) will return the pods (in the configured namespace) of the cluster defined in KUBECONFIG
.
so
export KUBECONFIG=/path/to/a/kube/config
kubeconfig get po [TAB]
will return the pods in the cluster (and namespace) configured in KUBECONFIG.
Now an alias like alias k-test="KUBECONFIG=/path/to/kube/config kubecfg"
with _complete_alias
will complete using kubecfg
without the KUBECONFIG
environment.
Is it possible to somehow set the environment for this specific completion?