2
2
3
3
autoload -U is-at-least
4
4
5
- _gutenberg () {
5
+ _pass-gen () {
6
6
typeset -A opt_args
7
7
typeset -a _arguments_options
8
8
local ret=1
9
9
10
10
local context curcontext="$curcontext" state line
11
11
_arguments "${_arguments_options[@]}" \
12
- '-c+[Path to a config file other than config.toml]' \
13
- '--config=[Path to a config file other than config.toml]' \
14
- '-h[Prints help information]' \
15
- '--help[Prints help information]' \
16
- '-V[Prints version information]' \
17
- '--version[Prints version information]' \
18
- ":: :_gutenberg_commands" \
19
- "*::: :->gutenberg" \
12
+ ":: :_pass-gen_commands" \
13
+ "*::: :->pass-gen" \
20
14
&& ret=0
21
15
case $state in
22
- (gutenberg )
16
+ (pass-gen )
23
17
words=($line[1] "${words[@]}")
24
18
(( CURRENT += 1 ))
25
- curcontext="${curcontext%:*:*}:gutenberg -command-$line[1]:"
19
+ curcontext="${curcontext%:*:*}:pass-gen -command-$line[1]:"
26
20
case $line[1] in
27
21
(init)
28
22
_arguments "${_arguments_options[@]}" \
29
- '-h[Prints help information]' \
30
- '--help[Prints help information]' \
31
- '-V[Prints version information]' \
32
- '--version[Prints version information]' \
33
- ':name -- Name of the project. Will create a new directory with that name in the current directory:_files' \
34
- && ret=0
35
- ;;
36
- (build)
37
- _arguments "${_arguments_options[@]}" \
38
- '-u+[Force the base URL to be that value (default to the one in config.toml)]' \
39
- '--base-url=[Force the base URL to be that value (default to the one in config.toml)]' \
40
- '-o+[Outputs the generated site in the given path]' \
41
- '--output-dir=[Outputs the generated site in the given path]' \
42
- '-h[Prints help information]' \
43
- '--help[Prints help information]' \
44
- '-V[Prints version information]' \
45
- '--version[Prints version information]' \
46
- && ret=0
47
- ;;
48
- (serve)
49
- _arguments "${_arguments_options[@]}" \
50
- '-i+[Interface to bind on]' \
51
- '--interface=[Interface to bind on]' \
52
- '-p+[Which port to use]' \
53
- '--port=[Which port to use]' \
54
- '-o+[Outputs the generated site in the given path]' \
55
- '--output-dir=[Outputs the generated site in the given path]' \
56
- '-u+[Changes the base_url]' \
57
- '--base-url=[Changes the base_url]' \
58
- '-h[Prints help information]' \
59
- '--help[Prints help information]' \
60
- '-V[Prints version information]' \
61
- '--version[Prints version information]' \
62
- && ret=0
63
- ;;
64
- (help)
65
- _arguments "${_arguments_options[@]}" \
66
- '-h[Prints help information]' \
67
- '--help[Prints help information]' \
68
- '-V[Prints version information]' \
69
- '--version[Prints version information]' \
23
+ '' \
70
24
&& ret=0
71
25
;;
72
26
esac
73
27
;;
74
28
esac
75
29
}
76
30
77
- (( $+functions[_gutenberg_commands ] )) ||
78
- _gutenberg_commands () {
31
+ (( $+functions[_pass-gen_commands ] )) ||
32
+ _pass-gen_commands () {
79
33
local commands; commands=(
80
- "init:Create a new project" \
81
- "--length:use NUMBER words to generate the passphrase" \
34
+ "--length:use NUMBER words to generate the passphrase" \
82
35
"-l:use NUMBER words to generate the passphrase" \
83
36
"--padding-before:preceed passphrase with NUMBER random numbers" \
84
37
"--padding-after:follow passphrase with NUMBER random numbers" \
@@ -95,6 +48,6 @@ _gutenberg_commands() {
95
48
"--help:display help message and exit" \
96
49
"-h:display help message and exit"
97
50
)
98
- _describe -t commands 'gutenberg commands' commands "$@"
51
+ _describe -t commands 'pass-gen commands' commands "$@"
99
52
}
100
- _gutenberg "$@"
53
+ _pass-gen "$@"
0 commit comments