summaryrefslogtreecommitdiff
path: root/Completion/Unix/Command/_env
diff options
context:
space:
mode:
authorAxel Beckert <abe@deuxchevaux.org>2022-04-11 00:18:04 +0200
committerAxel Beckert <abe@deuxchevaux.org>2022-04-11 00:18:04 +0200
commit31bcc5c263aea983e967426e2b94269e7605dcd4 (patch)
tree7b48ad9d7799afe09b7d7d8adc980bd5db935bdf /Completion/Unix/Command/_env
parent5086b5356abcef8849dc8a09902b7c55f01db3c0 (diff)
parentb09f4483416c54c1782824633dfabaf2ec0265b6 (diff)
downloadzsh-31bcc5c263aea983e967426e2b94269e7605dcd4.tar.gz
zsh-31bcc5c263aea983e967426e2b94269e7605dcd4.zip
Update upstream source from tag 'upstream/5.8.1.2-test'
Update to upstream version '5.8.1.2-test' with Debian dir b380d582bf51cd93149e4dea28fffa1ad85db4f5
Diffstat (limited to 'Completion/Unix/Command/_env')
-rw-r--r--Completion/Unix/Command/_env34
1 files changed, 27 insertions, 7 deletions
diff --git a/Completion/Unix/Command/_env b/Completion/Unix/Command/_env
index 27978d936..a5dd49d37 100644
--- a/Completion/Unix/Command/_env
+++ b/Completion/Unix/Command/_env
@@ -1,6 +1,7 @@
#compdef env genv
-local context state line variant args ign ret=1
+local context state line variant ign ret=1
+local -a args suf
_pick_variant -r variant gnu=Free\ Soft $OSTYPE --version
case $variant in
@@ -20,8 +21,15 @@ case $variant in
"${ign}(- *)--version[display version information]"
)
;;
- freebsd*|darwin*)
+ freebsd*)
args=(
+ '-0[use NUL, not newline after each variable in output]'
+ '-L[add variables from system login.conf(5)]: :->user-class'
+ '-U[add variables from user and system login.conf(5)]: :->user-class'
+ )
+ ;|
+ freebsd*|darwin*|dragonfly*)
+ args+=(
'(-i)*-u+[remove variable from the environment]:env var to remove:_parameters -g "*export*"'
'-P+[specify alternate executable search PATH]:path:_dir_list'
'-S+[perform word splitting]:string to split'
@@ -44,11 +52,23 @@ _arguments $args \
'*::arguments:->normal' && ret=0
if [[ -n $state ]]; then
- while [[ $words[1] = *=* ]]; do
- shift words
- (( CURRENT-- ))
- done
- _normal && ret=0
+ case $state in
+ normal)
+ while [[ $words[1] = *=* ]]; do
+ shift words
+ (( CURRENT-- ))
+ done
+ _normal && ret=0
+ ;;
+ user-class)
+ if compset -P 1 '*/'; then
+ _login_classes && ret=0
+ else
+ compset -S '/*' || suf=( -qS/ )
+ _users $suf && ret=0
+ fi
+ ;;
+ esac
fi
return ret