From d7417bdc0e500fff5f6890c3ee1f70dff54c3f18 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Fri, 13 Apr 2001 18:42:13 +0000 Subject: add completion for common MUAs and a couple of minor fixes (13982) --- Completion/Unix/Command/_mail | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 Completion/Unix/Command/_mail (limited to 'Completion/Unix/Command/_mail') diff --git a/Completion/Unix/Command/_mail b/Completion/Unix/Command/_mail new file mode 100644 index 000000000..7194ebac8 --- /dev/null +++ b/Completion/Unix/Command/_mail @@ -0,0 +1,24 @@ +#compdef mail mailx Mail mush zmail + +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 -- cgit 1.4.1