1 # Set up command completion for zsh
3 fetchmailauthtypes=(password kerberos kerberos_v5)
4 fetchmailprotocols=(auto pop2 pop3 apop rpop kpop sdps imap imap-k4 imap-gss etrn)
5 function fetchmailformattedinterfaces ()
6 { reply=(`ifconfig|perl -e '$/="";while(<>){s/[\r\n]//g;if(/^(\w+\d*).*inet addr:([\d\.]+)/){print "$1/$2\n";}}'`) }
7 function fetchmailcompctl ()
8 { reply=(`awk '{ print $2 }' < ~/.fetchmailrc` `fetchmail --help 2>&1| cut -c 7-19 | sed "s/,//g"`) }
9 compctl -K fetchmailcompctl \
10 -x "C[-1,-L|--logfile]" -f \
11 - "C[-1,-f|--fetchmailrc]" -f \
12 - "C[-1,-i|--idfile]" -f \
13 - "C[-1,-I|--interface]" -K fetchmailformattedinterfaces \
14 - "C[-1,-M|--monitor]" -K fetchmailformattedinterfaces \
15 - "C[-1,-p|--protocol]" -k fetchmailprotocols \
16 - "C[-1,-A|--auth]" -k fetchmailauthtypes \
17 - "c[-1,--plugin]" -m \
18 - "c[-1,--plugout]" -m \