Merge remote-tracking branch 'origin/github/pr/145'
[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-full   grml64-full
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         DEBORPHAN FRESHCLAM
37         GRMLBASE GRML_FULL GRML_SMALL
38         LATEX LATEX_CLEANUP LOCALES NO_ONLINE RELEASE REMOVE_DOCS SOURCES XORG ZFS
39         I386 AMD64 ARM64
40     )
41     compset -P '*,'
42     already=(${(s<,>)IPREFIX})
43     _wanted list expl 'classe(s)' compadd -S, -F already -q ${expl} -- \
44         /etc/grml/fai/config/class/*(.N:t:r) ${static_classes}
45 }
46 #}}}
47 _grmllive_suites() { #{{{
48   local expl
49   local -a suites
50
51   suites=(
52     stable testing unstable bookworm sid trixie
53   )
54   _wanted list expl 'Debian suite' compadd ${expl} -- ${suites}
55 }
56 #}}}
57 arguments=( #{{{
58   '-a[specifiy architecture to use]:arch(s):_grmllive_archs'
59   '-A[clean build directories before and after running]'
60   '-b[build the ISO without updating the chroot via FAI]'
61   '-B[build the ISO without touching the chroot (skips cleanup)]'
62   '-c[available grml-live classes]:classe(s):_grmllive_classes'
63   '-C[configuration file for grml-live]:configuration file:_files'
64   '-d[use specified date instead of build time as date of release]:date:'
65   '-D[use specified configuration directory instead of /etc/grml/fai]:directory:_path_files -/'
66   '-e[extract ISO and squashfs contents from iso_name]:ISO file:'
67   '-F[force execution without prompting for yes/no]'
68   '-g[grml flavour to use]:grml flavour(s):_grmllive_flavours'
69   '-h[display usage information]'
70   '-i[iso name, ends up in $OUTPUT_DIRECTORY/grml_isos (also see -o)]:ISO name:_files'
71   '-I[directory which provides files that should become part of the chroot/ISO]:directory to include:_path_files -/'
72   '-n[skip generation of ISO]'
73   '-N[bootstrap (build chroot) only, do not create files for ISO]'
74   '-o[output directory]:output directory:_path_files -/'
75   '-q[skip mksquashfs]'
76   '-Q[skip netboot package build]'
77   '-r[release name]:release name:'
78   '-s[debian suite to be used for live-system]:Debian suite:_grmllive_suites'
79   '-S[place of scripts (defaults to /usr/share/grml-live/scripts)]:script directory:_path_files -/'
80   '-t[template directory]:template directory:_path_files -/'
81   '-u[update existing chroot instead of rebuilding it from scratch]'
82   '-U[arrange output to be owned by specified username]'
83   '-V[increase verbosity]'
84   '-w[wayback machine, build system using Debian archives from specified date]:date:'
85   '-z[use ZLIB instead of LZMA/XZ compression]'
86 )
87 #}}}
88
89 _arguments -s $arguments
90
91 ## END OF FILE #################################################################
92 # vim:foldmethod=marker