complete-alias icon indicating copy to clipboard operation
complete-alias copied to clipboard

`_complete_alias` with environment variable influencing behavior

Open ibotty opened this issue 1 year ago • 0 comments

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?

ibotty avatar May 04 '23 12:05 ibotty