go env can show values of individual environment variables
This commit is contained in:
parent
17239cec96
commit
0a0894d07c
|
@ -196,18 +196,19 @@ case $state in
|
||||||
_arguments \
|
_arguments \
|
||||||
'-json[print the environment in JSON format]' \
|
'-json[print the environment in JSON format]' \
|
||||||
'-u[unset environment variables]' \
|
'-u[unset environment variables]' \
|
||||||
'-w[change the default setting of environment variables]'
|
'-w[change the default setting of environment variables]' \
|
||||||
|
'*:[show environment variable]:_values ${goenvvars%=}'
|
||||||
else
|
else
|
||||||
case $words[2] in
|
case $words[2] in
|
||||||
-u)
|
|
||||||
_values -s ' ' -w 'environment variable' ${goenvvars%=}
|
|
||||||
;;
|
|
||||||
-w)
|
-w)
|
||||||
if compset -P '*='; then
|
if compset -P '*='; then
|
||||||
else
|
else
|
||||||
_values -S "=" 'environment variable' $goenvvars
|
_values -S "=" 'environment variable' $goenvvars
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
*)
|
||||||
|
_values -s ' ' -w 'environment variable' ${goenvvars%=}
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
Loading…
Reference in New Issue