From 8a76df0af34e78341340e6690c9f798f1da9bdbf Mon Sep 17 00:00:00 2001 From: Vincent Prouillet Date: Fri, 20 Oct 2017 10:44:14 +0200 Subject: [PATCH] Update completions --- completions/_gutenberg | 60 ++++++++++++++------------- completions/_gutenberg.ps1 | 10 ++--- completions/gutenberg.bash-completion | 38 ++++++++++++----- completions/gutenberg.fish | 33 ++++++++------- 4 files changed, 82 insertions(+), 59 deletions(-) diff --git a/completions/_gutenberg b/completions/_gutenberg index 68f660d0..a4977e30 100644 --- a/completions/_gutenberg +++ b/completions/_gutenberg @@ -6,51 +6,56 @@ _gutenberg() { 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]" \ +'-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" \ +"*:: :->gutenberg" \ && ret=0 case $state in - (Gutenberg) + (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]" \ +'-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]" \ +'-u+[Force the base URL to be that value (default to the one in config.toml)]' \ +'--base-url+[Force the base URL to be that value (default to the one in config.toml)]' \ +'-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" \ +'-i+[Interface to bind on]' \ +'--interface+[Interface to bind on]' \ +'-p+[Which port to use]' \ +'--port+[Which port to use]' \ +'-h[Prints help information]' \ +'--help[Prints help information]' \ +'-V[Prints version information]' \ +'--version[Prints version information]' \ && ret=0 ;; (help) _arguments -s -S -C \ -"-h[Prints help information]" \ -"--help[Prints help information]" \ -"-V[Prints version information]" \ -"--version[Prints version information]" \ +'-h[Prints help information]' \ +'--help[Prints help information]' \ +'-V[Prints version information]' \ +'--version[Prints version information]' \ && ret=0 ;; esac @@ -85,15 +90,14 @@ _gutenberg__help_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" \ + "NAME:Name of the project. Will create a new 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 "$@" } diff --git a/completions/_gutenberg.ps1 b/completions/_gutenberg.ps1 index ec383f15..1bb1bdae 100644 --- a/completions/_gutenberg.ps1 +++ b/completions/_gutenberg.ps1 @@ -9,8 +9,8 @@ %{ switch ($_.ToString()) { - 'Gutenberg' { - $command += '_Gutenberg' + 'gutenberg' { + $command += '_gutenberg' break } @@ -45,7 +45,7 @@ switch ($command) { '_gutenberg' { - $completions = @('init', 'build', 'serve', 'help', '-h', '-V', '-c', '--help', '--version', '--config') + $completions = @('init', 'build', 'serve', 'help', '-c', '-h', '-V', '--config', '--help', '--version') } '_gutenberg_init' { @@ -53,11 +53,11 @@ } '_gutenberg_build' { - $completions = @('-h', '-V', '--help', '--version') + $completions = @('-h', '-V', '-u', '--help', '--version', '--base-url') } '_gutenberg_serve' { - $completions = @('-h', '-V', '--help', '--version') + $completions = @('-h', '-V', '-i', '-p', '--help', '--version', '--interface', '--port') } '_gutenberg_help' { diff --git a/completions/gutenberg.bash-completion b/completions/gutenberg.bash-completion index 9b48b690..2d0e1409 100644 --- a/completions/gutenberg.bash-completion +++ b/completions/gutenberg.bash-completion @@ -32,21 +32,13 @@ _gutenberg() { case "${cmd}" in gutenberg) - opts=" -h -V -c --help --version --config init build serve help" + opts=" -c -h -V --config --help --version init build serve help" if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) return 0 fi case "${prev}" in - --config) - COMPREPLY=("") - return 0 - ;; - -c) - COMPREPLY=("") - return 0 - ;; *) COMPREPLY=() ;; @@ -56,13 +48,21 @@ _gutenberg() { ;; gutenberg__build) - opts=" -h -V --help --version " + opts=" -h -V -u --help --version --base-url " if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) return 0 fi case "${prev}" in + --base-url) + COMPREPLY=("") + return 0 + ;; + -u) + COMPREPLY=("") + return 0 + ;; *) COMPREPLY=() ;; @@ -101,13 +101,29 @@ _gutenberg() { return 0 ;; gutenberg__serve) - opts=" -h -V --help --version " + opts=" -h -V -i -p --help --version --interface --port " if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) return 0 fi case "${prev}" in + --interface) + COMPREPLY=("") + return 0 + ;; + -i) + COMPREPLY=("") + return 0 + ;; + --port) + COMPREPLY=("") + return 0 + ;; + -p) + COMPREPLY=("") + return 0 + ;; *) COMPREPLY=() ;; diff --git a/completions/gutenberg.fish b/completions/gutenberg.fish index 7e5d6fa5..ce23d5d3 100644 --- a/completions/gutenberg.fish +++ b/completions/gutenberg.fish @@ -11,18 +11,21 @@ function __fish_using_command return 1 end -complete -c gutenberg -n "__fish_using_command gutenberg" -s c -l config -d "Path to a config file other than config.toml" -complete -c gutenberg -n "__fish_using_command gutenberg" -s h -l help -d "Prints help information" -complete -c gutenberg -n "__fish_using_command gutenberg" -s V -l version -d "Prints version information" -complete -c gutenberg -n "__fish_using_command gutenberg" -f -a "init" -d "Create a new Gutenberg project" -complete -c gutenberg -n "__fish_using_command gutenberg" -f -a "build" -d "Builds the site" -complete -c gutenberg -n "__fish_using_command gutenberg" -f -a "serve" -d "Serve the site. Rebuild and reload on change automatically" -complete -c gutenberg -n "__fish_using_command gutenberg" -f -a "help" -d "Prints this message or the help of the given subcommand(s)" -complete -c gutenberg -n "__fish_using_command gutenberg init" -s h -l help -d "Prints help information" -complete -c gutenberg -n "__fish_using_command gutenberg init" -s V -l version -d "Prints version information" -complete -c gutenberg -n "__fish_using_command gutenberg build" -s h -l help -d "Prints help information" -complete -c gutenberg -n "__fish_using_command gutenberg build" -s V -l version -d "Prints version information" -complete -c gutenberg -n "__fish_using_command gutenberg serve" -s h -l help -d "Prints help information" -complete -c gutenberg -n "__fish_using_command gutenberg serve" -s V -l version -d "Prints version information" -complete -c gutenberg -n "__fish_using_command gutenberg help" -s h -l help -d "Prints help information" -complete -c gutenberg -n "__fish_using_command gutenberg help" -s V -l version -d "Prints version information" +complete -c gutenberg -n "__fish_using_command gutenberg" -s c -l config -d 'Path to a config file other than config.toml' +complete -c gutenberg -n "__fish_using_command gutenberg" -s h -l help -d 'Prints help information' +complete -c gutenberg -n "__fish_using_command gutenberg" -s V -l version -d 'Prints version information' +complete -c gutenberg -n "__fish_using_command gutenberg" -f -a "init" -d 'Create a new Gutenberg project' +complete -c gutenberg -n "__fish_using_command gutenberg" -f -a "build" -d 'Builds the site' +complete -c gutenberg -n "__fish_using_command gutenberg" -f -a "serve" -d 'Serve the site. Rebuild and reload on change automatically' +complete -c gutenberg -n "__fish_using_command gutenberg" -f -a "help" -d 'Prints this message or the help of the given subcommand(s)' +complete -c gutenberg -n "__fish_using_command gutenberg init" -s h -l help -d 'Prints help information' +complete -c gutenberg -n "__fish_using_command gutenberg init" -s V -l version -d 'Prints version information' +complete -c gutenberg -n "__fish_using_command gutenberg build" -s u -l base-url -d 'Force the base URL to be that value (default to the one in config.toml)' +complete -c gutenberg -n "__fish_using_command gutenberg build" -s h -l help -d 'Prints help information' +complete -c gutenberg -n "__fish_using_command gutenberg build" -s V -l version -d 'Prints version information' +complete -c gutenberg -n "__fish_using_command gutenberg serve" -s i -l interface -d 'Interface to bind on' +complete -c gutenberg -n "__fish_using_command gutenberg serve" -s p -l port -d 'Which port to use' +complete -c gutenberg -n "__fish_using_command gutenberg serve" -s h -l help -d 'Prints help information' +complete -c gutenberg -n "__fish_using_command gutenberg serve" -s V -l version -d 'Prints version information' +complete -c gutenberg -n "__fish_using_command gutenberg help" -s h -l help -d 'Prints help information' +complete -c gutenberg -n "__fish_using_command gutenberg help" -s V -l version -d 'Prints version information'