]> git.xonotic.org Git - xonotic/xonotic.git/blob - misc/tools/all/zsh_autocompletion/all/_all
Fix macOS SDL2 framework permissions
[xonotic/xonotic.git] / misc / tools / all / zsh_autocompletion / all / _all
1 #compdef all
2
3 zstyle ":completion:*:descriptions" format "%B%d%b"
4
5
6 local context state line ret=1
7 typeset -A opt_args
8
9
10 local -a _1st_arguments
11 _1st_arguments=(
12     'help:print the help message'
13     {update,pull}':update all repos'
14     'compile:compile the source code'
15     'clean:clean all repos'
16     'run:run the game'
17     'update-maps:download the latest version of all official maps from the autobuild server'
18     'compile-map:compile the specified maps'
19     'serverbench:run the server benchmark'
20     'fix_upstream_rebase:fix upstream rebase'
21     'fix_config:fix .git/config'
22     'keygen:generate ssh key for repo access if one does not exist yet'
23     {checkout,switch}':checkout a specific branch in repos where it exists and default branch elsewhere'
24     'branch:create a branch in a repo (asks for repo)'
25     {push,commit}':commit and push changes'
26     {each,foreach}':run a command in each repo'
27     'grep:run "git grep" in all repos'
28 )
29
30 _arguments -C \
31     '1: :->cmds' \
32     '*:: :->args' && ret=0
33
34
35 case $state in
36     cmds)
37         _describe -t actions 'commands' _1st_arguments
38         ret=0
39         ;;
40
41     args)
42         case $words[1] in
43         run)
44             # choose version and autocomplete cvars
45             # possible TODO: check for OS and adapt to it
46             _arguments \
47                 '1:Version:(sdl dedicated)' && ret=0
48             ;;
49
50         compile)
51             _arguments \
52                 '1:Version:(sdl dedicated)' \
53                 "-0[don't use precompiled d0_blind_id]" \
54                 "-1[don't compile d0_blind_id]" \
55                 '-c[clean all before building]' \
56                 '-qc[clean QuakeC binaries]' \
57                 - '(debug)' \
58                     '-d[build in debug mode]' \
59                 - '(profile)' \
60                     '-p[build in profile mode]' \
61                 - '(release)' \
62                     '-r[build in release mode (default)]' && ret=0
63             ;;
64
65         compile-map)
66             _files -W "(data/xonotic-maps.pk3dir/maps)" -g "*.map(:r)" && ret=0
67             ;;
68
69         clean)
70             _arguments \
71                 - '(noreclone)' \
72                     '-f[force clean]' \
73                     '-u[go to upstream]' \
74                     '-U[go to upstream and fetch master]' \
75                     '-m[go to master]' \
76                     '-r[remove untracked files]' \
77                     '-D[kill branches]' \
78                 - '(reclone)' \
79                     '--reclone[set all the other flags (effectively a reclone)]' && ret=0
80             ;;
81
82         update|pull)
83             _arguments \
84                 "-N[reset git config for each repo]" \
85                 '-l[find the best mirror in the specified location]' \
86                 - '(ssh)' \
87                     {-p,-s}'[set ssh as push protocol and find the best mirror]' \
88                 - '(git)' \
89                     '-g[set git as push protocol and find the best mirror]' \
90                 - '(http)' \
91                     '-h[set http as push protocol and find the best mirror]' && ret=0
92             ;;
93
94         esac
95         ;;
96 esac
97
98 return ret