101 lines
2.8 KiB
Plaintext
101 lines
2.8 KiB
Plaintext
#compdef gutenberg
|
|
|
|
_gutenberg() {
|
|
typeset -A opt_args
|
|
local ret=1
|
|
|
|
local context curcontext="$curcontext" state line
|
|
_arguments -s -S -C \
|
|
"-c+[Path to a config file other than config.toml]" \
|
|
"--config+[Path to a config file other than config.toml]" \
|
|
"-h[Prints help information]" \
|
|
"--help[Prints help information]" \
|
|
"-V[Prints version information]" \
|
|
"--version[Prints version information]" \
|
|
"1:: :_gutenberg_commands" \
|
|
"*:: :->Gutenberg" \
|
|
&& ret=0
|
|
case $state in
|
|
(Gutenberg)
|
|
curcontext="${curcontext%:*:*}:gutenberg-command-$words[1]:"
|
|
case $line[1] in
|
|
(init)
|
|
_arguments -s -S -C \
|
|
"-h[Prints help information]" \
|
|
"--help[Prints help information]" \
|
|
"-V[Prints version information]" \
|
|
"--version[Prints version information]" \
|
|
"1:: :_gutenberg__init_commands" \
|
|
&& ret=0
|
|
;;
|
|
(build)
|
|
_arguments -s -S -C \
|
|
"-h[Prints help information]" \
|
|
"--help[Prints help information]" \
|
|
"-V[Prints version information]" \
|
|
"--version[Prints version information]" \
|
|
&& ret=0
|
|
;;
|
|
(serve)
|
|
_arguments -s -S -C \
|
|
"-h[Prints help information]" \
|
|
"--help[Prints help information]" \
|
|
"-V[Prints version information]" \
|
|
"--version[Prints version information]" \
|
|
"1:: :_gutenberg__serve_commands" \
|
|
&& ret=0
|
|
;;
|
|
(help)
|
|
_arguments -s -S -C \
|
|
"-h[Prints help information]" \
|
|
"--help[Prints help information]" \
|
|
"-V[Prints version information]" \
|
|
"--version[Prints version information]" \
|
|
&& ret=0
|
|
;;
|
|
esac
|
|
;;
|
|
esac
|
|
}
|
|
|
|
(( $+functions[_gutenberg_commands] )) ||
|
|
_gutenberg_commands() {
|
|
local commands; commands=(
|
|
"init:Create a new Gutenberg project" \
|
|
"build:Builds the site" \
|
|
"serve:Serve the site. Rebuild and reload on change automatically" \
|
|
"help:Prints this message or the help of the given subcommand(s)" \
|
|
)
|
|
_describe -t commands 'gutenberg commands' commands "$@"
|
|
}
|
|
(( $+functions[_gutenberg__build_commands] )) ||
|
|
_gutenberg__build_commands() {
|
|
local commands; commands=(
|
|
|
|
)
|
|
_describe -t commands 'gutenberg build commands' commands "$@"
|
|
}
|
|
(( $+functions[_gutenberg__help_commands] )) ||
|
|
_gutenberg__help_commands() {
|
|
local commands; commands=(
|
|
|
|
)
|
|
_describe -t commands 'gutenberg help commands' commands "$@"
|
|
}
|
|
(( $+functions[_gutenberg__init_commands] )) ||
|
|
_gutenberg__init_commands() {
|
|
local commands; commands=(
|
|
"NAME:Name of the project. Will create a directory with that name in the current directory" \
|
|
)
|
|
_describe -t commands 'gutenberg init commands' commands "$@"
|
|
}
|
|
(( $+functions[_gutenberg__serve_commands] )) ||
|
|
_gutenberg__serve_commands() {
|
|
local commands; commands=(
|
|
"INTERFACE:Interface to bind on (default to 127.0.0.1)" \
|
|
"PORT:Which port to use (default to 1111)" \
|
|
)
|
|
_describe -t commands 'gutenberg serve commands' commands "$@"
|
|
}
|
|
|
|
_gutenberg "$@" |