go env can show values of individual environment variables

This commit is contained in:
Paul Seyfert 2019-08-23 14:42:29 +02:00
parent 17239cec96
commit 0a0894d07c
1 changed files with 5 additions and 4 deletions

View File

@ -196,18 +196,19 @@ case $state in
_arguments \
'-json[print the environment in JSON format]' \
'-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
case $words[2] in
-u)
_values -s ' ' -w 'environment variable' ${goenvvars%=}
;;
-w)
if compset -P '*='; then
else
_values -S "=" 'environment variable' $goenvvars
fi
;;
*)
_values -s ' ' -w 'environment variable' ${goenvvars%=}
;;
esac
fi
;;