summaryrefslogtreecommitdiff
path: root/completion/_mutt-wizard.zsh
blob: 619a20c9137c6b029cf8d75fda5880007b1f6802 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#compdef mw

_arguments \
    '1:flag:->flags' \
    '*:: :->args'

case "$state" in
    flags)
        local -a opts
        opts=(
            '-a:Add an email address'
            '-c:Create basic mailboxes for all accounts'
            '-d:Remove an already added address'
            '-D:Force remove account without confirmation'
            '-l:List email addresses configured'
            '-r:order account numbers'
            '-t:Toggle automatic mailsync every <number> minutes'
            '-T:Toggle automatic mailsync every 10 minutes'
            '-y:Sync mail for account by name'
            '-Y:Sync mail for all accounts'
            '-u:Show a registered email account information'
            '-X:Delete an account'\''s local email too when deleting'
        )
            _describe 'flags' opts
            ;;
        args)
            case $line[1] in
                -a)
                    _alternative \
                        'args: :((
        -f\:"Assume typical English mailboxes without attempting log-on."
        -i\:"IMAP/POP server address"
        -I\:"IMAP/POP server port"
        -m\:"Maximum number of emails to be kept offline (default=0: unlimited)"
        -n\:"Real name to be on the email account"
        -N\:"Account login name if not full address"
        -o\:"Configure address, but keep mail online."
        -p\:"Add for a POP server instead of IMAP."
        -P\:"Pass Prefix (prefix of the file where password is stored)"
        -s\:"SMTP server address"
        -S\:"SMTP server port"
        -x\:"Password for account (recommended to be in double quotes)"
                    -X\:"Delete an account'"'"'s local email too when deleting."
            ))'
                ;;
            -D|-y) _values 'email list' $(mw -l | cut -f2) 2>/dev/null ;;
        esac
        ;;
esac