28363d4761ca1b092817da09a69115ff01a47951
[grml-etc-core.git] / usr_share_grml / zsh / completion / unix / _hl_complete
1 #compdef hl
2
3 function _hl_genarg()  {
4     local expl
5     if [[ -prefix 1 *: ]] ; then
6         local themes
7         themes=(${${${(f)"$(LC_ALL=C highlight --list-themes)"}/ #/}:#*(Installed|Use name)*})
8         compset -P 1 '*:'
9         _wanted -C list themes expl theme compadd ${themes}
10     else
11         local langs
12         langs=(${${${(f)"$(LC_ALL=C highlight --list-langs)"}/ #/}:#*(Installed|Use name)*})
13         _wanted -C list languages expl languages compadd -S ':' -q ${langs}
14     fi
15 }
16
17 _arguments -s '1: :_hl_genarg' '2:files:_path_files'