f2ce3ca3176efe094f280baf56221a780aaa7a81
[grml-live.git] / etc / zsh / completion.d / _grml-live
1 #compdef grml-live
2 # Filename:      /etc/zsh/completion.d/_grml-live
3 # Purpose:       completion for command grml-live for zsh (z shell)
4 # Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
5 # Bug-Reports:   see http://grml.org/bugs/
6 # License:       This file is licensed under the GPL v2.
7 ################################################################################
8
9 _grmllive_flavours() { #{{{
10   local expl
11   local -a flavours
12
13   flavours=(
14     grml        grml64
15     grml-medium grml64-medium
16     grml-small  grml64-small
17   )
18   _wanted list expl 'grml flavour(s)' compadd ${expl} -- ${flavours}
19 }
20 #}}}
21 _grmllive_archs() { #{{{
22   local expl runningarch
23   local -a archs
24
25   runningarch="$(dpkg --print-architecture)"
26   archs=( ${runningarch} )
27   [[ ${runningarch} == 'amd64' ]] && archs=( ${archs} 'i386')
28   _wanted list expl 'target architecture' compadd ${expl} -- ${archs}
29 }
30 #}}}
31 _grmllive_classes() { #{{{
32     local expl
33     local -a already static_classes
34
35     static_classes=(
36         RELEASE LATEX_CLEANUP NO_ONLINE REMOVE_DOCS LOCALES
37         I386 AMD64
38     )
39     compset -P '*,'
40     already=(${(s<,>)IPREFIX})
41     _wanted list expl 'classe(s)' compadd -S, -F already -q ${expl} -- \
42         /etc/grml/fai/config/class/*(.N:t:r) ${static_classes}
43 }
44 #}}}
45 _grmllive_suites() { #{{{
46   local expl
47   local -a suites
48
49   suites=(
50     stable testing unstable wheezy jessie sid
51   )
52   _wanted list expl 'Debian suite' compadd ${expl} -- ${suites}
53 }
54 #}}}
55 arguments=( #{{{
56   '-F[force execution without prompting for yes/no]'
57   '-a[specifiy architecture to use]:arch(s):_grmllive_archs'
58   '-c[available grml-live classes]:classe(s):_grmllive_classes'
59   '-g[grml flavour to use]:grml flavour(s):_grmllive_flavours'
60   '-h[display usage information]'
61   '-i[iso name, ends up in $OUTPUT_DIRECTORY/grml_isos]:iso name:'
62   '-o[output directory]:output directory:_path_files -/'
63   '-s[debian suite to be used for live-system]:Debian suite:_grmllive_suites'
64   '-t[template directory]:template directory:_path_files -/'
65   '-u[update existing chroot if possible]'
66   '-V[increase verbosity]'
67 )
68 #}}}
69
70 _arguments -s $arguments
71
72 ## END OF FILE #################################################################
73 # vim:foldmethod=marker