mirror of https://github.com/passcod/cargo-watch
Update completions
This commit is contained in:
parent
268b1a530a
commit
9c8dcaa144
|
@ -1,7 +1,7 @@
|
|||
.\" generated with Ronn/v0.7.3
|
||||
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
||||
.
|
||||
.TH "CARGO\-WATCH" "1" "January 2022" "" ""
|
||||
.TH "CARGO\-WATCH" "1" "July 2022" "" ""
|
||||
.
|
||||
.SH "NAME"
|
||||
\fBcargo\-watch\fR \- watches over your Cargo project\'s source
|
||||
|
|
|
@ -21,15 +21,8 @@ Register-ArgumentCompleter -Native -CommandName 'cargo-watch' -ScriptBlock {
|
|||
|
||||
$completions = @(switch ($command) {
|
||||
'cargo-watch' {
|
||||
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help information')
|
||||
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help information')
|
||||
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Print version information')
|
||||
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Print version information')
|
||||
[CompletionResult]::new('watch', 'watch', [CompletionResultType]::ParameterValue, 'Watch your Cargo-based project and run commands when files change')
|
||||
[CompletionResult]::new('help', 'help', [CompletionResultType]::ParameterValue, 'Print this message or the help of the given subcommand(s)')
|
||||
break
|
||||
}
|
||||
'cargo-watch;watch' {
|
||||
[CompletionResult]::new('--delay-run', 'delay-run', [CompletionResultType]::ParameterName, 'Sleep some time before running commands')
|
||||
[CompletionResult]::new('--quit-after-n', 'quit-after-n', [CompletionResultType]::ParameterName, 'Quit after a set amount of triggers')
|
||||
[CompletionResult]::new('--features', 'features', [CompletionResultType]::ParameterName, 'Feature(s) passed to cargo invocations')
|
||||
[CompletionResult]::new('-x', 'x', [CompletionResultType]::ParameterName, 'Cargo command(s) to execute on changes')
|
||||
[CompletionResult]::new('--exec', 'exec', [CompletionResultType]::ParameterName, 'Cargo command(s) to execute on changes')
|
||||
|
@ -43,10 +36,18 @@ Register-ArgumentCompleter -Native -CommandName 'cargo-watch' -ScriptBlock {
|
|||
[CompletionResult]::new('--package', 'package', [CompletionResultType]::ParameterName, 'Reserved for workspace support')
|
||||
[CompletionResult]::new('-w', 'w', [CompletionResultType]::ParameterName, 'Watch specific file(s) or folder(s)')
|
||||
[CompletionResult]::new('--watch', 'watch', [CompletionResultType]::ParameterName, 'Watch specific file(s) or folder(s)')
|
||||
[CompletionResult]::new('-S', 'S', [CompletionResultType]::ParameterName, 'Shell to use for --shell commands, or `none` for direct execution')
|
||||
[CompletionResult]::new('--use-shell', 'use-shell', [CompletionResultType]::ParameterName, 'Shell to use for --shell commands, or `none` for direct execution')
|
||||
[CompletionResult]::new('-C', 'C', [CompletionResultType]::ParameterName, 'Change working directory of the command')
|
||||
[CompletionResult]::new('--workdir', 'workdir', [CompletionResultType]::ParameterName, 'Change working directory of the command')
|
||||
[CompletionResult]::new('--testing-only--once', 'testing-only--once', [CompletionResultType]::ParameterName, 'testing-only--once')
|
||||
[CompletionResult]::new('-E', 'E', [CompletionResultType]::ParameterName, 'Inject environment variables into the commands'' environments')
|
||||
[CompletionResult]::new('--env', 'env', [CompletionResultType]::ParameterName, 'Inject environment variables into the commands'' environments')
|
||||
[CompletionResult]::new('-B', 'B', [CompletionResultType]::ParameterName, 'Inject RUST_BACKTRACE=value into the commands'' environments')
|
||||
[CompletionResult]::new('-L', 'L', [CompletionResultType]::ParameterName, 'Inject RUST_LOG=value into the commands'' environments')
|
||||
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Show the help')
|
||||
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Show the help')
|
||||
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Show the version')
|
||||
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Show the version')
|
||||
[CompletionResult]::new('-c', 'c', [CompletionResultType]::ParameterName, 'Clear the screen before each run')
|
||||
[CompletionResult]::new('--clear', 'clear', [CompletionResultType]::ParameterName, 'Clear the screen before each run')
|
||||
[CompletionResult]::new('--debug', 'debug', [CompletionResultType]::ParameterName, 'Show debug output')
|
||||
|
@ -62,15 +63,7 @@ Register-ArgumentCompleter -Native -CommandName 'cargo-watch' -ScriptBlock {
|
|||
[CompletionResult]::new('--quiet', 'quiet', [CompletionResultType]::ParameterName, 'Suppress output from cargo watch itself')
|
||||
[CompletionResult]::new('-N', 'N', [CompletionResultType]::ParameterName, 'Send a desktop notification on command start and end')
|
||||
[CompletionResult]::new('--notify', 'notify', [CompletionResultType]::ParameterName, 'Send a desktop notification on command start and end')
|
||||
[CompletionResult]::new('-B', 'B', [CompletionResultType]::ParameterName, 'Inject RUST_BACKTRACE=value into the command''s environment')
|
||||
[CompletionResult]::new('-L', 'L', [CompletionResultType]::ParameterName, 'Inject RUST_LOG=value into the command''s environment')
|
||||
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help information')
|
||||
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help information')
|
||||
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Print version information')
|
||||
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Print version information')
|
||||
break
|
||||
}
|
||||
'cargo-watch;help' {
|
||||
[CompletionResult]::new('--no-auto-env', 'no-auto-env', [CompletionResultType]::ParameterName, 'Don’t inject CARGO_WATCH_* variables in the environment')
|
||||
break
|
||||
}
|
||||
})
|
||||
|
|
|
@ -15,21 +15,8 @@ _cargo-watch() {
|
|||
|
||||
local context curcontext="$curcontext" state line
|
||||
_arguments "${_arguments_options[@]}" \
|
||||
'-h[Print help information]' \
|
||||
'--help[Print help information]' \
|
||||
'-V[Print version information]' \
|
||||
'--version[Print version information]' \
|
||||
":: :_cargo-watch_commands" \
|
||||
"*::: :->cargo-watch" \
|
||||
&& ret=0
|
||||
case $state in
|
||||
(cargo-watch)
|
||||
words=($line[1] "${words[@]}")
|
||||
(( CURRENT += 1 ))
|
||||
curcontext="${curcontext%:*:*}:cargo-watch-command-$line[1]:"
|
||||
case $line[1] in
|
||||
(watch)
|
||||
_arguments "${_arguments_options[@]}" \
|
||||
'--delay-run=[Sleep some time before running commands]:seconds: ' \
|
||||
'--quit-after-n=[Quit after a set amount of triggers]:number: ' \
|
||||
'*--features=[Feature(s) passed to cargo invocations]:FEATURES: ' \
|
||||
'*-x+[Cargo command(s) to execute on changes]:cmd: ' \
|
||||
'*--exec=[Cargo command(s) to execute on changes]:cmd: ' \
|
||||
|
@ -43,10 +30,18 @@ _arguments "${_arguments_options[@]}" \
|
|||
'*--package=[Reserved for workspace support]:spec: ' \
|
||||
'*-w+[Watch specific file(s) or folder(s)]:path: ' \
|
||||
'*--watch=[Watch specific file(s) or folder(s)]:path: ' \
|
||||
'*-S+[Shell to use for --shell commands, or `none` for direct execution]:shell: ' \
|
||||
'*--use-shell=[Shell to use for --shell commands, or `none` for direct execution]:shell: ' \
|
||||
'-C+[Change working directory of the command]:path: ' \
|
||||
'--workdir=[Change working directory of the command]:path: ' \
|
||||
'--testing-only--once[]' \
|
||||
'*-E+[Inject environment variables into the commands'\'' environments]:key=value: ' \
|
||||
'*--env=[Inject environment variables into the commands'\'' environments]:key=value: ' \
|
||||
'-B+[Inject RUST_BACKTRACE=value into the commands'\'' environments]:RUST_BACKTRACE value: ' \
|
||||
'-L+[Inject RUST_LOG=value into the commands'\'' environments]:RUST_LOG value: ' \
|
||||
'-h[Show the help]' \
|
||||
'--help[Show the help]' \
|
||||
'-V[Show the version]' \
|
||||
'--version[Show the version]' \
|
||||
'-c[Clear the screen before each run]' \
|
||||
'--clear[Clear the screen before each run]' \
|
||||
'--debug[Show debug output]' \
|
||||
|
@ -62,42 +57,15 @@ _arguments "${_arguments_options[@]}" \
|
|||
'--quiet[Suppress output from cargo watch itself]' \
|
||||
'-N[Send a desktop notification on command start and end]' \
|
||||
'--notify[Send a desktop notification on command start and end]' \
|
||||
'-B[Inject RUST_BACKTRACE=value into the command'\''s environment]' \
|
||||
'-L[Inject RUST_LOG=value into the command'\''s environment]' \
|
||||
'-h[Print help information]' \
|
||||
'--help[Print help information]' \
|
||||
'-V[Print version information]' \
|
||||
'--version[Print version information]' \
|
||||
'--no-auto-env[Don’t inject CARGO_WATCH_* variables in the environment]' \
|
||||
'*::cmd-trail -- Full command to run. -x and -s will be ignored!:' \
|
||||
&& ret=0
|
||||
;;
|
||||
(help)
|
||||
_arguments "${_arguments_options[@]}" \
|
||||
'*::subcommand -- The subcommand whose help message to display:' \
|
||||
&& ret=0
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
(( $+functions[_cargo-watch_commands] )) ||
|
||||
_cargo-watch_commands() {
|
||||
local commands; commands=(
|
||||
'watch:Watch your Cargo-based project and run commands when files change' \
|
||||
'help:Print this message or the help of the given subcommand(s)' \
|
||||
)
|
||||
local commands; commands=()
|
||||
_describe -t commands 'cargo-watch commands' commands "$@"
|
||||
}
|
||||
(( $+functions[_cargo-watch__help_commands] )) ||
|
||||
_cargo-watch__help_commands() {
|
||||
local commands; commands=()
|
||||
_describe -t commands 'cargo-watch help commands' commands "$@"
|
||||
}
|
||||
(( $+functions[_cargo-watch__watch_commands] )) ||
|
||||
_cargo-watch__watch_commands() {
|
||||
local commands; commands=()
|
||||
_describe -t commands 'cargo-watch watch commands' commands "$@"
|
||||
}
|
||||
|
||||
_cargo-watch "$@"
|
||||
|
|
|
@ -12,12 +12,6 @@ _cargo-watch() {
|
|||
"$1")
|
||||
cmd="cargo__watch"
|
||||
;;
|
||||
help)
|
||||
cmd+="__help"
|
||||
;;
|
||||
watch)
|
||||
cmd+="__watch"
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
|
@ -25,40 +19,20 @@ _cargo-watch() {
|
|||
|
||||
case "${cmd}" in
|
||||
cargo__watch)
|
||||
opts="-h -V --help --version watch help"
|
||||
opts="-h -V -c -q -x -s -d -i -p -w -S -C -N -E -B -L --help --version --clear --debug --why --ignore-nothing --no-gitignore --no-ignore --no-restart --all --poll --postpone --delay-run --quit-after-n --features --quiet --exec --shell --delay --ignore --package --watch --use-shell --workdir --notify --env --no-auto-env <trailing command>..."
|
||||
if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]] ; then
|
||||
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
||||
return 0
|
||||
fi
|
||||
case "${prev}" in
|
||||
*)
|
||||
COMPREPLY=()
|
||||
--delay-run)
|
||||
COMPREPLY=($(compgen -f "${cur}"))
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
||||
return 0
|
||||
;;
|
||||
cargo__watch__help)
|
||||
opts="<SUBCOMMAND>..."
|
||||
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
|
||||
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
||||
return 0
|
||||
fi
|
||||
case "${prev}" in
|
||||
*)
|
||||
COMPREPLY=()
|
||||
--quit-after-n)
|
||||
COMPREPLY=($(compgen -f "${cur}"))
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
||||
return 0
|
||||
;;
|
||||
cargo__watch__watch)
|
||||
opts="-c -q -x -s -d -i -p -w -C -N -B -L -h -V --testing-only--once --clear --debug --why --ignore-nothing --no-gitignore --no-ignore --no-restart --all --poll --postpone --features --quiet --exec --shell --delay --ignore --package --watch --use-shell --workdir --notify --help --version <trailing command>..."
|
||||
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
|
||||
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
||||
return 0
|
||||
fi
|
||||
case "${prev}" in
|
||||
--features)
|
||||
COMPREPLY=($(compgen -f "${cur}"))
|
||||
return 0
|
||||
|
@ -115,6 +89,10 @@ _cargo-watch() {
|
|||
COMPREPLY=($(compgen -f "${cur}"))
|
||||
return 0
|
||||
;;
|
||||
-S)
|
||||
COMPREPLY=($(compgen -f "${cur}"))
|
||||
return 0
|
||||
;;
|
||||
--workdir)
|
||||
COMPREPLY=($(compgen -f "${cur}"))
|
||||
return 0
|
||||
|
@ -123,6 +101,22 @@ _cargo-watch() {
|
|||
COMPREPLY=($(compgen -f "${cur}"))
|
||||
return 0
|
||||
;;
|
||||
--env)
|
||||
COMPREPLY=($(compgen -f "${cur}"))
|
||||
return 0
|
||||
;;
|
||||
-E)
|
||||
COMPREPLY=($(compgen -f "${cur}"))
|
||||
return 0
|
||||
;;
|
||||
-B)
|
||||
COMPREPLY=($(compgen -f "${cur}"))
|
||||
return 0
|
||||
;;
|
||||
-L)
|
||||
COMPREPLY=($(compgen -f "${cur}"))
|
||||
return 0
|
||||
;;
|
||||
*)
|
||||
COMPREPLY=()
|
||||
;;
|
||||
|
|
|
@ -18,14 +18,8 @@ set edit:completion:arg-completer[cargo-watch] = {|@words|
|
|||
}
|
||||
var completions = [
|
||||
&'cargo-watch'= {
|
||||
cand -h 'Print help information'
|
||||
cand --help 'Print help information'
|
||||
cand -V 'Print version information'
|
||||
cand --version 'Print version information'
|
||||
cand watch 'Watch your Cargo-based project and run commands when files change'
|
||||
cand help 'Print this message or the help of the given subcommand(s)'
|
||||
}
|
||||
&'cargo-watch;watch'= {
|
||||
cand --delay-run 'Sleep some time before running commands'
|
||||
cand --quit-after-n 'Quit after a set amount of triggers'
|
||||
cand --features 'Feature(s) passed to cargo invocations'
|
||||
cand -x 'Cargo command(s) to execute on changes'
|
||||
cand --exec 'Cargo command(s) to execute on changes'
|
||||
|
@ -39,10 +33,18 @@ set edit:completion:arg-completer[cargo-watch] = {|@words|
|
|||
cand --package 'Reserved for workspace support'
|
||||
cand -w 'Watch specific file(s) or folder(s)'
|
||||
cand --watch 'Watch specific file(s) or folder(s)'
|
||||
cand -S 'Shell to use for --shell commands, or `none` for direct execution'
|
||||
cand --use-shell 'Shell to use for --shell commands, or `none` for direct execution'
|
||||
cand -C 'Change working directory of the command'
|
||||
cand --workdir 'Change working directory of the command'
|
||||
cand --testing-only--once 'testing-only--once'
|
||||
cand -E 'Inject environment variables into the commands'' environments'
|
||||
cand --env 'Inject environment variables into the commands'' environments'
|
||||
cand -B 'Inject RUST_BACKTRACE=value into the commands'' environments'
|
||||
cand -L 'Inject RUST_LOG=value into the commands'' environments'
|
||||
cand -h 'Show the help'
|
||||
cand --help 'Show the help'
|
||||
cand -V 'Show the version'
|
||||
cand --version 'Show the version'
|
||||
cand -c 'Clear the screen before each run'
|
||||
cand --clear 'Clear the screen before each run'
|
||||
cand --debug 'Show debug output'
|
||||
|
@ -58,14 +60,7 @@ set edit:completion:arg-completer[cargo-watch] = {|@words|
|
|||
cand --quiet 'Suppress output from cargo watch itself'
|
||||
cand -N 'Send a desktop notification on command start and end'
|
||||
cand --notify 'Send a desktop notification on command start and end'
|
||||
cand -B 'Inject RUST_BACKTRACE=value into the command''s environment'
|
||||
cand -L 'Inject RUST_LOG=value into the command''s environment'
|
||||
cand -h 'Print help information'
|
||||
cand --help 'Print help information'
|
||||
cand -V 'Print version information'
|
||||
cand --version 'Print version information'
|
||||
}
|
||||
&'cargo-watch;help'= {
|
||||
cand --no-auto-env 'Don’t inject CARGO_WATCH_* variables in the environment'
|
||||
}
|
||||
]
|
||||
$completions[$command]
|
||||
|
|
|
@ -1,190 +1,201 @@
|
|||
const completion: Fig.Spec = {
|
||||
name: "cargo-watch",
|
||||
description: "",
|
||||
subcommands: [
|
||||
description: "Watch your Cargo-based project and run commands when files change",
|
||||
options: [
|
||||
{
|
||||
name: "watch",
|
||||
description: "Watch your Cargo-based project and run commands when files change",
|
||||
options: [
|
||||
{
|
||||
name: "--features",
|
||||
description: "Feature(s) passed to cargo invocations",
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "features",
|
||||
isOptional: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: ["-x", "--exec"],
|
||||
description: "Cargo command(s) to execute on changes",
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "cmd-cargo",
|
||||
isVariadic: true,
|
||||
isOptional: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: ["-s", "--shell"],
|
||||
description: "Shell command(s) to execute on changes",
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "cmd-shell",
|
||||
isVariadic: true,
|
||||
isOptional: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: ["-d", "--delay"],
|
||||
description: "File updates debounce delay",
|
||||
args: {
|
||||
name: "delay",
|
||||
isOptional: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: ["-i", "--ignore"],
|
||||
description: "Ignore a path pattern",
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "ignores",
|
||||
isVariadic: true,
|
||||
isOptional: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: ["-p", "--package"],
|
||||
description: "Reserved for workspace support",
|
||||
hidden: true,
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "packages-specs",
|
||||
isVariadic: true,
|
||||
isOptional: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: ["-w", "--watch"],
|
||||
description: "Watch specific file(s) or folder(s)",
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "watch",
|
||||
isVariadic: true,
|
||||
isOptional: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "--use-shell",
|
||||
description: "Shell to use for --shell commands, or `none` for direct execution",
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "use-shell",
|
||||
isVariadic: true,
|
||||
isOptional: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: ["-C", "--workdir"],
|
||||
description: "Change working directory of the command",
|
||||
args: {
|
||||
name: "workdir",
|
||||
isOptional: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "--testing-only--once",
|
||||
},
|
||||
{
|
||||
name: ["-c", "--clear"],
|
||||
description: "Clear the screen before each run",
|
||||
},
|
||||
{
|
||||
name: "--debug",
|
||||
description: "Show debug output",
|
||||
},
|
||||
{
|
||||
name: "--why",
|
||||
description: "Show paths that changed",
|
||||
},
|
||||
{
|
||||
name: "--ignore-nothing",
|
||||
description: "Ignore nothing, not even target/ and .git/",
|
||||
},
|
||||
{
|
||||
name: "--no-gitignore",
|
||||
description: "Don’t use .gitignore files",
|
||||
},
|
||||
{
|
||||
name: "--no-ignore",
|
||||
description: "Don’t use .ignore files",
|
||||
},
|
||||
{
|
||||
name: "--no-restart",
|
||||
description: "Don’t restart command while it’s still running",
|
||||
},
|
||||
{
|
||||
name: "--all",
|
||||
description: "Reserves for workspace support",
|
||||
},
|
||||
{
|
||||
name: "--poll",
|
||||
description: "Force use of polling for file changes",
|
||||
},
|
||||
{
|
||||
name: "--postpone",
|
||||
description: "Postpone first run until a file changes",
|
||||
},
|
||||
{
|
||||
name: ["-q", "--quiet"],
|
||||
description: "Suppress output from cargo watch itself",
|
||||
},
|
||||
{
|
||||
name: ["-N", "--notify"],
|
||||
description: "Send a desktop notification on command start and end",
|
||||
},
|
||||
{
|
||||
name: "-B",
|
||||
description: "Inject RUST_BACKTRACE=value into the command's environment",
|
||||
},
|
||||
{
|
||||
name: "-L",
|
||||
description: "Inject RUST_LOG=value into the command's environment",
|
||||
},
|
||||
{
|
||||
name: ["-h", "--help"],
|
||||
description: "Print help information",
|
||||
},
|
||||
{
|
||||
name: ["-V", "--version"],
|
||||
description: "Print version information",
|
||||
},
|
||||
],
|
||||
name: "--delay-run",
|
||||
description: "Sleep some time before running commands",
|
||||
args: {
|
||||
name: "cmd-trail",
|
||||
name: "delay-run",
|
||||
isOptional: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "--quit-after-n",
|
||||
description: "Quit after a set amount of triggers",
|
||||
args: {
|
||||
name: "quit-after-n",
|
||||
isOptional: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "--features",
|
||||
description: "Feature(s) passed to cargo invocations",
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "features",
|
||||
isOptional: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: ["-x", "--exec"],
|
||||
description: "Cargo command(s) to execute on changes",
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "cmd-cargo",
|
||||
isVariadic: true,
|
||||
isOptional: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "help",
|
||||
description: "Print this message or the help of the given subcommand(s)",
|
||||
name: ["-s", "--shell"],
|
||||
description: "Shell command(s) to execute on changes",
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "subcommand",
|
||||
name: "cmd-shell",
|
||||
isVariadic: true,
|
||||
isOptional: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: ["-d", "--delay"],
|
||||
description: "File updates debounce delay",
|
||||
args: {
|
||||
name: "delay",
|
||||
isOptional: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: ["-i", "--ignore"],
|
||||
description: "Ignore a path pattern",
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "ignores",
|
||||
isVariadic: true,
|
||||
isOptional: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: ["-p", "--package"],
|
||||
description: "Reserved for workspace support",
|
||||
hidden: true,
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "packages-specs",
|
||||
isVariadic: true,
|
||||
isOptional: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: ["-w", "--watch"],
|
||||
description: "Watch specific file(s) or folder(s)",
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "watch",
|
||||
isVariadic: true,
|
||||
isOptional: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: ["-S", "--use-shell"],
|
||||
description: "Shell to use for --shell commands, or `none` for direct execution",
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "use-shell",
|
||||
isVariadic: true,
|
||||
isOptional: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: ["-C", "--workdir"],
|
||||
description: "Change working directory of the command",
|
||||
args: {
|
||||
name: "workdir",
|
||||
isOptional: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: ["-E", "--env"],
|
||||
description: "Inject environment variables into the commands' environments",
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "env-vars",
|
||||
isVariadic: true,
|
||||
isOptional: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-B",
|
||||
description: "Inject RUST_BACKTRACE=value into the commands' environments",
|
||||
args: {
|
||||
name: "env-backtrace",
|
||||
isOptional: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-L",
|
||||
description: "Inject RUST_LOG=value into the commands' environments",
|
||||
args: {
|
||||
name: "env-log",
|
||||
isOptional: true,
|
||||
},
|
||||
},
|
||||
],
|
||||
options: [
|
||||
{
|
||||
name: ["-h", "--help"],
|
||||
description: "Print help information",
|
||||
description: "Show the help",
|
||||
},
|
||||
{
|
||||
name: ["-V", "--version"],
|
||||
description: "Print version information",
|
||||
description: "Show the version",
|
||||
},
|
||||
{
|
||||
name: ["-c", "--clear"],
|
||||
description: "Clear the screen before each run",
|
||||
},
|
||||
{
|
||||
name: "--debug",
|
||||
description: "Show debug output",
|
||||
},
|
||||
{
|
||||
name: "--why",
|
||||
description: "Show paths that changed",
|
||||
},
|
||||
{
|
||||
name: "--ignore-nothing",
|
||||
description: "Ignore nothing, not even target/ and .git/",
|
||||
},
|
||||
{
|
||||
name: "--no-gitignore",
|
||||
description: "Don’t use .gitignore files",
|
||||
},
|
||||
{
|
||||
name: "--no-ignore",
|
||||
description: "Don’t use .ignore files",
|
||||
},
|
||||
{
|
||||
name: "--no-restart",
|
||||
description: "Don’t restart command while it’s still running",
|
||||
},
|
||||
{
|
||||
name: "--all",
|
||||
description: "Reserves for workspace support",
|
||||
},
|
||||
{
|
||||
name: "--poll",
|
||||
description: "Force use of polling for file changes",
|
||||
},
|
||||
{
|
||||
name: "--postpone",
|
||||
description: "Postpone first run until a file changes",
|
||||
},
|
||||
{
|
||||
name: ["-q", "--quiet"],
|
||||
description: "Suppress output from cargo watch itself",
|
||||
},
|
||||
{
|
||||
name: ["-N", "--notify"],
|
||||
description: "Send a desktop notification on command start and end",
|
||||
},
|
||||
{
|
||||
name: "--no-auto-env",
|
||||
description: "Don’t inject CARGO_WATCH_* variables in the environment",
|
||||
},
|
||||
],
|
||||
args: {
|
||||
name: "cmd-trail",
|
||||
isVariadic: true,
|
||||
isOptional: true,
|
||||
},
|
||||
};
|
||||
|
||||
export default completion;
|
||||
|
|
|
@ -1,30 +1,29 @@
|
|||
complete -c cargo-watch -n "__fish_use_subcommand" -s h -l help -d 'Print help information'
|
||||
complete -c cargo-watch -n "__fish_use_subcommand" -s V -l version -d 'Print version information'
|
||||
complete -c cargo-watch -n "__fish_use_subcommand" -f -a "watch" -d 'Watch your Cargo-based project and run commands when files change'
|
||||
complete -c cargo-watch -n "__fish_use_subcommand" -f -a "help" -d 'Print this message or the help of the given subcommand(s)'
|
||||
complete -c cargo-watch -n "__fish_seen_subcommand_from watch" -l features -d 'Feature(s) passed to cargo invocations' -r
|
||||
complete -c cargo-watch -n "__fish_seen_subcommand_from watch" -s x -l exec -d 'Cargo command(s) to execute on changes' -r
|
||||
complete -c cargo-watch -n "__fish_seen_subcommand_from watch" -s s -l shell -d 'Shell command(s) to execute on changes' -r
|
||||
complete -c cargo-watch -n "__fish_seen_subcommand_from watch" -s d -l delay -d 'File updates debounce delay' -r
|
||||
complete -c cargo-watch -n "__fish_seen_subcommand_from watch" -s i -l ignore -d 'Ignore a path pattern' -r
|
||||
complete -c cargo-watch -n "__fish_seen_subcommand_from watch" -s p -l package -d 'Reserved for workspace support' -r
|
||||
complete -c cargo-watch -n "__fish_seen_subcommand_from watch" -s w -l watch -d 'Watch specific file(s) or folder(s)' -r
|
||||
complete -c cargo-watch -n "__fish_seen_subcommand_from watch" -l use-shell -d 'Shell to use for --shell commands, or `none` for direct execution' -r
|
||||
complete -c cargo-watch -n "__fish_seen_subcommand_from watch" -s C -l workdir -d 'Change working directory of the command' -r
|
||||
complete -c cargo-watch -n "__fish_seen_subcommand_from watch" -l testing-only--once
|
||||
complete -c cargo-watch -n "__fish_seen_subcommand_from watch" -s c -l clear -d 'Clear the screen before each run'
|
||||
complete -c cargo-watch -n "__fish_seen_subcommand_from watch" -l debug -d 'Show debug output'
|
||||
complete -c cargo-watch -n "__fish_seen_subcommand_from watch" -l why -d 'Show paths that changed'
|
||||
complete -c cargo-watch -n "__fish_seen_subcommand_from watch" -l ignore-nothing -d 'Ignore nothing, not even target/ and .git/'
|
||||
complete -c cargo-watch -n "__fish_seen_subcommand_from watch" -l no-gitignore -d 'Don’t use .gitignore files'
|
||||
complete -c cargo-watch -n "__fish_seen_subcommand_from watch" -l no-ignore -d 'Don’t use .ignore files'
|
||||
complete -c cargo-watch -n "__fish_seen_subcommand_from watch" -l no-restart -d 'Don’t restart command while it’s still running'
|
||||
complete -c cargo-watch -n "__fish_seen_subcommand_from watch" -l all -d 'Reserves for workspace support'
|
||||
complete -c cargo-watch -n "__fish_seen_subcommand_from watch" -l poll -d 'Force use of polling for file changes'
|
||||
complete -c cargo-watch -n "__fish_seen_subcommand_from watch" -l postpone -d 'Postpone first run until a file changes'
|
||||
complete -c cargo-watch -n "__fish_seen_subcommand_from watch" -s q -l quiet -d 'Suppress output from cargo watch itself'
|
||||
complete -c cargo-watch -n "__fish_seen_subcommand_from watch" -s N -l notify -d 'Send a desktop notification on command start and end'
|
||||
complete -c cargo-watch -n "__fish_seen_subcommand_from watch" -s B -d 'Inject RUST_BACKTRACE=value into the command\'s environment'
|
||||
complete -c cargo-watch -n "__fish_seen_subcommand_from watch" -s L -d 'Inject RUST_LOG=value into the command\'s environment'
|
||||
complete -c cargo-watch -n "__fish_seen_subcommand_from watch" -s h -l help -d 'Print help information'
|
||||
complete -c cargo-watch -n "__fish_seen_subcommand_from watch" -s V -l version -d 'Print version information'
|
||||
complete -c cargo-watch -l delay-run -d 'Sleep some time before running commands' -r
|
||||
complete -c cargo-watch -l quit-after-n -d 'Quit after a set amount of triggers' -r
|
||||
complete -c cargo-watch -l features -d 'Feature(s) passed to cargo invocations' -r
|
||||
complete -c cargo-watch -s x -l exec -d 'Cargo command(s) to execute on changes' -r
|
||||
complete -c cargo-watch -s s -l shell -d 'Shell command(s) to execute on changes' -r
|
||||
complete -c cargo-watch -s d -l delay -d 'File updates debounce delay' -r
|
||||
complete -c cargo-watch -s i -l ignore -d 'Ignore a path pattern' -r
|
||||
complete -c cargo-watch -s p -l package -d 'Reserved for workspace support' -r
|
||||
complete -c cargo-watch -s w -l watch -d 'Watch specific file(s) or folder(s)' -r
|
||||
complete -c cargo-watch -s S -l use-shell -d 'Shell to use for --shell commands, or `none` for direct execution' -r
|
||||
complete -c cargo-watch -s C -l workdir -d 'Change working directory of the command' -r
|
||||
complete -c cargo-watch -s E -l env -d 'Inject environment variables into the commands\' environments' -r
|
||||
complete -c cargo-watch -s B -d 'Inject RUST_BACKTRACE=value into the commands\' environments' -r
|
||||
complete -c cargo-watch -s L -d 'Inject RUST_LOG=value into the commands\' environments' -r
|
||||
complete -c cargo-watch -s h -l help -d 'Show the help'
|
||||
complete -c cargo-watch -s V -l version -d 'Show the version'
|
||||
complete -c cargo-watch -s c -l clear -d 'Clear the screen before each run'
|
||||
complete -c cargo-watch -l debug -d 'Show debug output'
|
||||
complete -c cargo-watch -l why -d 'Show paths that changed'
|
||||
complete -c cargo-watch -l ignore-nothing -d 'Ignore nothing, not even target/ and .git/'
|
||||
complete -c cargo-watch -l no-gitignore -d 'Don’t use .gitignore files'
|
||||
complete -c cargo-watch -l no-ignore -d 'Don’t use .ignore files'
|
||||
complete -c cargo-watch -l no-restart -d 'Don’t restart command while it’s still running'
|
||||
complete -c cargo-watch -l all -d 'Reserves for workspace support'
|
||||
complete -c cargo-watch -l poll -d 'Force use of polling for file changes'
|
||||
complete -c cargo-watch -l postpone -d 'Postpone first run until a file changes'
|
||||
complete -c cargo-watch -s q -l quiet -d 'Suppress output from cargo watch itself'
|
||||
complete -c cargo-watch -s N -l notify -d 'Send a desktop notification on command start and end'
|
||||
complete -c cargo-watch -l no-auto-env -d 'Don’t inject CARGO_WATCH_* variables in the environment'
|
||||
|
|
|
@ -18,7 +18,7 @@ fn main() -> Result<(), Error> {
|
|||
}
|
||||
|
||||
fn gen_help(gen: impl Generator) -> Result<(), Error> {
|
||||
let mut app = args::App::into_app();
|
||||
let mut app = args::Args::into_app();
|
||||
let path = generate_to(gen, &mut app, "cargo-watch", "./completions/")?;
|
||||
println!("completion file is generated: {:?}", path);
|
||||
Ok(())
|
||||
|
|
Loading…
Reference in New Issue