From 7f3590c68fa37812a4f79ceb5a41bdd7ca565067 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Mon, 15 Mar 2010 19:35:26 +0000 Subject: Alexey: 27789: use _arguments in _sudo --- Completion/Unix/Command/_sudo | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) (limited to 'Completion/Unix/Command/_sudo') diff --git a/Completion/Unix/Command/_sudo b/Completion/Unix/Command/_sudo index 23afb4046..384e9358b 100644 --- a/Completion/Unix/Command/_sudo +++ b/Completion/Unix/Command/_sudo @@ -25,21 +25,18 @@ args=( '-S[read password from stdin]' ) -if [[ $service = sudoedit || -n $words[(R)-e] ]]; then - args+=( +if [[ $service = sudoedit ]]; then + _arguments $args \ '*:file: _files' - ) else - args+=( - '-b[run command in background]' - '-E[preserve environment]' - '-H[set HOME environment variable]' - '-P[preserve group vector]' - '(-i)-s[run SHELL]' - '(-s)-i[simulate login]' - '(-):command name: _command_names -e' + _arguments $args \ + '(- :)-e[edit file]:*:file:_files' \ + '(- :)-s[run SHELL]' \ + '(- :)-i[simulate login]' \ + '(-i -s -e)-b[run command in background]' \ + '(-i -s -e)-E[preserve environment]' \ + '(-i -s -e)-H[set HOME environment variable]' \ + '(-i -s -e)-P[preserve group vector]' \ + '(-):command: _command_names -e' \ '*::arguments: _normal' - ) fi - -_arguments $args -- cgit 1.4.1