Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

simply add an host completion



hi all,

i have a little wrapper for the screen command defined as 

> type -f s
s () {
  case $1 in
    ('g'|'go') [ -n "$2" ] && screen -RDS $2 || screen -r || screen ;;
    ('r'|'root') screen -t root sudo -s ;;
    ('l'|'ls') screen -ls ;;
    ('m'|'mail') screen -t mail mutt $*[2,-1] ;;
    ('i'|'irc') screen -t irc irssi ;;
    ('f'|'ftp') screen -t ftp lftp ;;
    ('d'|'doc') screen -t "doc:$*[2,-1]" info $*[2,-1] ;;
    ('e'|'edit') screen -t "${*[-1]:t}" ${EDITOR:-editor} $*[2,-1] ;;
    ('s'|'ssh') screen -t "$*[2,-1]" ssh $*[2,-1] ;;
    (*) screen $@ ;;
  esac
}

now i would like to add completion with it so
- s s would be completed by the ssh hosts completion. 
- s e would be completed by filenames. 
- s e would be completed by available info pages. 

i'm not sure about the best way to do that. Anyone would help ?

regards
mc

-- 
téléphone : 03.90.24.00.19
courriel  : marc.chantreux@xxxxxxxxxxxxxxxxxx
---------------------------------------



Messages sorted by: Reverse Date, Date, Thread, Author