diff options
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | Completion/Unix/Command/_killall | 9 | ||||
-rw-r--r-- | Completion/Unix/Command/_mail | 24 |
3 files changed, 40 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog index 6bb4c5e62..573905602 100644 --- a/ChangeLog +++ b/ChangeLog @@ -72,6 +72,13 @@ * 17571: Src/Modules/terminfo.c: backport of terminfo segfault fix from 4.1. +2002-08-19 Oliver Kiddle <opk@zsh.org> + + * unposted: Completion/X/Command/_nedit, Completion/Unix/Command/_mail, + Completion/Unix/Command/_killall, Completion/Unix/Type/_net_interfaces: + nedit 5.3 adds a -version option and complete for nail, + killall5, ifup and ifdown using existing functions + 2002-08-19 Felix Rosencrantz <f_rosencrantz@yahoo.com> * 16863, 17562: Completion/Unix/Command/.distfiles: diff --git a/Completion/Unix/Command/_killall b/Completion/Unix/Command/_killall new file mode 100644 index 000000000..6ec022227 --- /dev/null +++ b/Completion/Unix/Command/_killall @@ -0,0 +1,9 @@ +#compdef killall killall5 + +if [[ $service = killall && "$OSTYPE" = linux* ]]; then + _alternative \ + 'signals:: _signals -p' \ + 'processes:process:{ compadd "$expl[@]" ${${${${(f)"$(_call_program processes-names ps ${${EUID/(#s)0(#e)/xa}//[0-9]#/} ho cmd 2> /dev/null)"//[][\(\)]/}:#(ps|COMMAND|-*)}%%\ *}:t} }' +else + _signals -p +fi diff --git a/Completion/Unix/Command/_mail b/Completion/Unix/Command/_mail new file mode 100644 index 000000000..82a3a59d0 --- /dev/null +++ b/Completion/Unix/Command/_mail @@ -0,0 +1,24 @@ +#compdef mail mailx Mail mush zmail nail + +local curcontext="$curcontext" state line expl suf + +_arguments -C -s \ + '(-f -u)*-b[specify a BCC recipient]:BCC recipient:->userhost' \ + '(-f -u)*-c[specify a CC recipient]:CC recipient:->userhost' \ + '(-b -c -u -s *)-f+[specify mail folder]:mailbox:_mailboxes' \ + '(-f -u)-s+[specify a subject]:subject:' \ + "(-b -c -f -s *)-u+[read specified user's mail]:user:_users" \ + '(-f -u)*:recipient:->userhost' && return 0 + +if [[ "$state" = userhost ]]; then + if compset -P '*@'; then + _description hosts expl 'remote host name' + _hosts "$expl[@]" && return 0 + else + compset -S '@*' || suf='@' + _description users expl 'login name' + _users "$expl[@]" -q -S "$suf" && return 0 + fi +fi + +return 1 |