zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <pws@csr.com>
To: zsh-workers@sunsite.dk (Zsh hackers list)
Subject: PATCH: _sudo
Date: Fri, 08 May 2009 09:39:46 +0100	[thread overview]
Message-ID: <545.1241771986@csr.com> (raw)

It looks like I never sent this.

Index: Completion/Unix/Command/_sudo
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_sudo,v
retrieving revision 1.2
diff -u -r1.2 _sudo
--- Completion/Unix/Command/_sudo	10 Oct 2008 09:56:25 -0000	1.2
+++ Completion/Unix/Command/_sudo	6 May 2009 09:19:50 -0000
@@ -1,26 +1,45 @@
-#compdef sudo
+#compdef sudo sudoedit
 
 local curcontext="$curcontext" environ e
+local -a args
+
 zstyle -a "$curcontext" environ environ
 
 for e in "${environ[@]}"
 do local -x "$e"
 done
 
-_arguments \
-       '-V[show version]' \
-       '-l[list allowed commands]' \
-       '-L[list options from Default section]' \
-       '-h[show help]' \
-       '-v[validate user timestamp]' \
-       '-k[invalidate user timestamp]' \
-       '-K[remove user timestamp]' \
-       '-b[run command in background]' \
-       '-r[Kerberos realm]:Kerberos realm:' \
-       '-p[password prompt]:password prompt:' \
-       '-u[user name]:user name:_users' \
-       '-s[run SHELL]' \
-       '-H[set HOME environment variable]' \
-       '-S[read password from stdin]' \
-       '(-):command name: _command_names -e'  \
-       '*::arguments: _normal'
+args=(
+       '-V[show version]'
+       '-l[list allowed commands]'
+       '-L[list options from Default section]'
+       '-a[BSD auth type]:BSD auth type:'
+       '-c[BSD login class]:BSD login class:'
+       '-h[show help]'
+       '-v[validate user timestamp]'
+       '-k[invalidate user timestamp]'
+       '-K[remove user timestamp]'
+       '-r[Kerberos realm]:Kerberos realm:'
+       '-p[password prompt]:password prompt:'
+       '-u[user name]:user name:_users'
+       '-S[read password from stdin]'
+)
+
+if [[ $service = sudoedit || -n $words[(R)-e] ]]; then
+  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: _normal'
+  )
+fi
+
+_arguments $args


-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


             reply	other threads:[~2009-05-08  8:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-08  8:39 Peter Stephenson [this message]
  -- strict thread matches above, loose matches on Subject: below --
2000-03-09 10:12 Andrej Borsenkow

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=545.1241771986@csr.com \
    --to=pws@csr.com \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).