diff options
author | Axel Beckert <abe@deuxchevaux.org> | 2022-04-11 00:17:48 +0200 |
---|---|---|
committer | Axel Beckert <abe@deuxchevaux.org> | 2022-04-11 00:17:48 +0200 |
commit | b09f4483416c54c1782824633dfabaf2ec0265b6 (patch) | |
tree | 304bc82642862525ae680c7fbaa249663b10ad57 /Completion/Unix/Command/_sudo | |
parent | 12eb3e5356f2fc3351eed58ef1cef1b8fb83b504 (diff) | |
parent | 6e55c920503071e917619b8cb1a188cd35d772db (diff) | |
download | zsh-b09f4483416c54c1782824633dfabaf2ec0265b6.tar.gz zsh-b09f4483416c54c1782824633dfabaf2ec0265b6.zip |
New upstream version 5.8.1.2-test
Diffstat (limited to 'Completion/Unix/Command/_sudo')
-rw-r--r-- | Completion/Unix/Command/_sudo | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/Completion/Unix/Command/_sudo b/Completion/Unix/Command/_sudo index 41e32cbae..29e5e6d75 100644 --- a/Completion/Unix/Command/_sudo +++ b/Completion/Unix/Command/_sudo @@ -2,9 +2,9 @@ setopt localoptions extended_glob -local environ e cmd -local -a args -local -a _comp_priv_prefix +local environ e cmd cpp +local -a args _comp_priv_prefix +local -A opt_args zstyle -a ":completion:${curcontext}:" environ environ @@ -14,7 +14,9 @@ done args=( '(-A --askpass)'{-A,--askpass}'[use a helper program for password prompting]' + '(-B --bell)'{-B,--bell}'[ring bell when prompting]' '(-C --close-from)'{-C+,--close-from=}'[close file descriptors]:lowest fd to close' + '(-D --chdir)'{-D+,--chdir=}'[change the working directory before running command]:directory:_directories' '(-g --group)'{-g+,--group=}'[run command as the specified group name or ID]:group:_groups' '(-)'{-h,--help}'[display help message and exit]' '(-h --host)'{-h+,--host=}'[run command on host]:host:_hosts' @@ -23,6 +25,7 @@ args=( \*{-l,--list}"[list user's privileges or check a specific command]" '(-n --non-interactive)'{-n,--non-interactive}'[non-interactive mode, no prompts are used]' '(-p --prompt)'{-p+,--prompt=}'[use the specified password prompt]:prompt' + '(-R --chroot)'{-R+,--chroot=}'[change the root directory before running command]:directory:_directories' '(-r --role)'{-r+,--role=}'[create SELinux security context with specified role]: :_selinux_roles' '(-S --stdin)'{-S,--stdin}'[read password from standard input]' '(-t --type)'{-t+,--type=}'[create SELinux security context with specified type]: :_selinux_types' @@ -42,6 +45,10 @@ if [[ $service = sudoedit ]] || (( $words[(i)-e] < $words[(i)^(*sudo|-[^-]*)] )) args=( -A "-*" $args '!(-V --version -h --help)-e' '*:file:_files' ) else cmd="$words[1]" + cpp='_comp_priv_prefix=( + $cmd -n + ${(kv)opt_args[(I)(-[ugHEP]|--(user|group|set-home|preserve-env|preserve-groups))]} + )' args+=( '(-e --edit 1 *)'{-e,--edit}'[edit files instead of running a command]' \ '(-s --shell)'{-s,--shell}'[run shell as the target user; a command may also be specified]' \ @@ -51,8 +58,8 @@ else '(-E -i --login -s --shell -e --edit)--preserve-env=-[preserve user environment when running command]::environment variable:_sequence _parameters -g "*export*"' \ '(-H --set-home -i --login -s --shell -e --edit)'{-H,--set-home}"[set HOME variable to target user's home dir]" \ '(-P --preserve-groups -i -login -s --shell -e --edit)'{-P,--preserve-groups}"[preserve group vector instead of setting to target's]" \ - '(-)1:command: _command_names -e' - '*::arguments:{ _comp_priv_prefix=( $cmd -n ${(kv)opt_args[(I)(-[ugHEP]|--(user|group|set-home|preserve-env|preserve-groups))]} ) ; _normal }' + "(-)1: :{ $cpp; _command_names -e }" + "*:: :{ $cpp; _normal }" ) fi |