_nanoc
2624 bytes
1#compdef nanoc
2#autoload
3
4# requires the 'nanoc' gem to be installed
5
6local -a _1st_arguments
7_1st_arguments=(
8 'check:run issue checks'
9 'compile:compile items of this site'
10 'create-site:create a site'
11 'deploy:deploy the compiled site'
12 'help:show help'
13 'prune:remove files not managed by nanoc from the output directory'
14 'shell:open a shell on the Nanoc environment'
15 'show-data:show data in this site'
16 'show-plugins:show all available plugins'
17 'show-rules:describe the rules for each item'
18 'view:start the web server that serves static files'
19)
20
21local expl
22local -a pkgs installed_pkgs
23
24_arguments \
25 '(--color)--color[enable color]' \
26 '(--debug)--debug[enable debugging]' \
27 '(--env)--env[set environment]' \
28 '(--help)--help[show the help message and quit]' \
29 '(--no-color)--no-color[disable color]' \
30 '(--verbose)--verbose[make output more detailed]' \
31 '(--version)--version[show version information and quit]' \
32 '(--warn)--warn[enable warnings]' \
33 '*:: :->subcmds' && return 0
34
35case "$state" in
36 subcmds)
37 case $words[1] in
38 check)
39 _arguments \
40 '(--preprocess)--preprocess[run preprocessor]'
41 ;;
42
43 compile)
44 _arguments \
45 '(--diff)--diff[generate diff]'
46 ;;
47
48 compile)
49 _arguments \
50 '(--diff)--diff[generate diff]'
51 ;;
52
53 create-site)
54 _arguments \
55 '(--force)--force[force creation of new site]'
56 ;;
57
58 deploy)
59 _arguments \
60 '(--target)--target[specify the location to deploy to (default: `default`)]' \
61 '(--no-check)--no-check[do not run the issue checks marked for deployment]' \
62 '(--list)--list[list available locations to deploy to]' \
63 '(--list-deployers)--list-deployers[list available deployers]' \
64 '(--dry-run)--dry-run[show what would be deployed]'
65 ;;
66
67 prune)
68 _arguments \
69 '(--yes)--yes[confirm deletion]' \
70 '(--dry-run)--dry-run[print files to be deleted instead of actually deleting them]'
71 ;;
72
73 shell)
74 _arguments \
75 '(--preprocess)--preprocess[run preprocessor]'
76 ;;
77
78 view)
79 _arguments \
80 '(--handler)--handler[specify the handler to use (webrick/mongrel/...)]' \
81 '(--host)--host[specify the host to listen on (default: 127.0.0.1)]' \
82 '(--port)--port[specify the port to listen on (default: 3000]' \
83 '(--live-reload)--live-reload[reload on changes]'
84 ;;
85 esac
86 ;;
87esac
88
89if (( CURRENT == 1 )); then
90 _describe -t commands "nanoc subcommand" _1st_arguments
91 return
92fi