You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

33 lines
1.2 KiB

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