_mutt-wizard.zsh (1268B)
1 #compdef mw 2 3 _arguments \ 4 '1:flag:->flags' \ 5 '*:: :->args' 6 7 case "$state" in 8 flags) 9 local -a opts 10 opts=( 11 '-a:Add an email address' 12 '-l:List email addresses configured' 13 '-d:Remove an already added address' 14 '-D:Force remove account without confirmation' 15 '-y:Sync mail for account by name' 16 '-Y:Sync mail for all accounts' 17 '-t:Toggle automatic mailsync every <number> minutes' 18 '-T:Toggle automatic mailsync every 10 minutes' 19 '-r:order account numbers' 20 ) 21 _describe 'flags' opts 22 ;; 23 args) 24 case $line[1] in 25 -a) 26 _alternative \ 27 'args: :(( 28 -u\:"Account login name if not full address" 29 -n\:"Real name to be on the email account" 30 -i\:"IMAP/POP server address" 31 -I\:"IMAP/POP server port" 32 -s\:"SMTP server address" 33 -S\:"SMTP server port" 34 -x\:"Password for account (recommended to be in double quotes)" 35 -P\:"Pass Prefix (prefix of the file where password is stored)" 36 -p\:"Add for a POP server instead of IMAP." 37 -X\:"Delete an account'"'"'s local email too when deleting." 38 -o\:"Configure address, but keep mail online." 39 -f\:"Assume typical English mailboxes without attempting log-on." 40 ))' 41 ;; 42 -D|-y) 43 _values 'email list' $(mw -l | cut -f2) 2>/dev/null 44 esac 45 esac