diff options
author | Oliver Kiddle <opk@users.sourceforge.net> | 2002-09-26 12:11:05 +0000 |
---|---|---|
committer | Oliver Kiddle <opk@users.sourceforge.net> | 2002-09-26 12:11:05 +0000 |
commit | d3fdf5d8515c0e21d385581a6d063821a4a55e55 (patch) | |
tree | 984346d4754b0d6a18112cb3c97548e9740a8801 /Completion/Unix/Command/_mail | |
parent | 4fe68351652ba1455f2d525de8a3eaecda38446a (diff) | |
download | zsh-d3fdf5d8515c0e21d385581a6d063821a4a55e55.tar.gz zsh-d3fdf5d8515c0e21d385581a6d063821a4a55e55.tar.xz zsh-d3fdf5d8515c0e21d385581a6d063821a4a55e55.zip |
merge changes from 4.1 branch
Diffstat (limited to 'Completion/Unix/Command/_mail')
-rw-r--r-- | Completion/Unix/Command/_mail | 24 |
1 files changed, 24 insertions, 0 deletions
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 |