4d5f54ed4a9c0df19fbc8365599c6191181b5557
[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 # Latest change: Thu, 01 Nov 2007 14:00:40 +0100 [ft]
8 ################################################################################
9
10 _grmllive_flavours() { #{{{
11   local expl
12   local -a flavours
13
14   flavours=(
15     grml        grml64
16     grml-medium grml64-medium
17     grml-small  grml64-small
18   )
19   _wanted list expl 'grml flavour(s)' compadd ${expl} -- ${flavours}
20 }
21 #}}}
22 _grmllive_archs() { #{{{
23   local expl runningarch
24   local -a archs
25
26   runningarch="$(dpkg --print-architecture)"
27   archs=( ${runningarch} )
28   [[ ${runningarch} == 'amd64' ]] && archs=( ${archs} 'i386')
29   _wanted list expl 'target architecture' compadd ${expl} -- ${archs}
30 }
31 #}}}
32 _grmllive_classes() { #{{{
33     local expl
34     local -a already static_classes
35
36     static_classes=(RELEASE LATEX_CLEANUP NO_ONLINE REMOVE_DOCS LOCALES)
37     compset -P '*,'
38     already=(${(s<,>)IPREFIX})
39     _wanted list expl 'classe(s)' compadd -S, -F already -q ${expl} -- \
40         /etc/grml/fai/config/class/*(.N:t:r) ${static_classes}
41 }
42 #}}}
43 _grmllive_suites() { #{{{
44   local expl
45   local -a suites
46
47   suites=(
48     stable  testing unstable
49     etch    lenny   sid
50   )
51   _wanted list expl 'Debian suite' compadd ${expl} -- ${suites}
52 }
53 #}}}
54 arguments=( #{{{
55   '-F[force execution without prompting for yes/no]'
56   '-a[specifiy architecture to use]:arch(s):_grmllive_archs'
57   '-c[available grml-live classes]:classe(s):_grmllive_classes'
58   '-g[grml flavour to use]:grml flavour(s):_grmllive_flavours'
59   '-h[display usage information]'
60   '-i[iso name, ends up in $OUTPUT_DIRECTORY/grml_isos]:iso name:'
61   '-o[output directory]:output directory:_path_files -/'
62   '-s[debian suite to be used for live-system]:Debian suite:_grmllive_suites'
63   '-t[template directory]:template directory:_path_files -/'
64   '-u[update existing chroot if possible]'
65   '-V[increase verbosity]'
66 )
67 #}}}
68
69 _arguments -s $arguments
70
71 ## END OF FILE #################################################################
72 # vim:foldmethod=marker