mirror of
https://github.com/kristoferssolo/solorice.git
synced 2026-02-04 06:32:03 +00:00
Update 2026-01-31
Update 2026-01-27
This commit is contained in:
@@ -1,116 +0,0 @@
|
||||
#compdef bat
|
||||
|
||||
local curcontext="$curcontext" ret=1
|
||||
local -a state state_descr line
|
||||
typeset -A opt_args
|
||||
|
||||
(( $+functions[_bat_cache_subcommand] )) ||
|
||||
_bat_cache_subcommand() {
|
||||
local -a args
|
||||
args=(
|
||||
'(-b --build -c --clear)'{-b,--build}'[initialize or update the syntax/theme cache]'
|
||||
'(-b --build -c --clear)'{-c,--clear}'[remove the cached syntax definitions and themes]'
|
||||
--source='[specify directory to load syntaxes and themes from]:directory:_files -/'
|
||||
--target='[specify directory to store the cached syntax and theme set in]:directory:_files -/'
|
||||
--blank'[create completely new syntax and theme sets]'
|
||||
--acknowledgements'[build acknowledgements.bin]'
|
||||
'(: -)'{-h,--help}'[show help information]'
|
||||
)
|
||||
|
||||
_arguments -S -s $args
|
||||
}
|
||||
|
||||
(( $+functions[_bat_main] )) ||
|
||||
_bat_main() {
|
||||
local -a args
|
||||
args=(
|
||||
'(-A --show-all)'{-A,--show-all}'[show non-printable characters (space, tab, newline, ..)]'
|
||||
--nonprintable-notation='[specify how to display non-printable characters when using --show-all]:notation:(caret unicode)'
|
||||
\*{-p,--plain}'[show plain style (alias for `--style=plain`), repeat twice to disable automatic paging (alias for `--paging=never`)]'
|
||||
'(-l --language)'{-l+,--language=}'[set the language for syntax highlighting]:language:->languages'
|
||||
\*{-H+,--highlight-line=}'[highlight specified block of lines]:start\:end'
|
||||
\*--file-name='[specify the name to display for a file]:name:_files'
|
||||
'(-d --diff)'--diff'[only show lines that have been added/removed/modified]'
|
||||
--diff-context='[specify lines of context around added/removed/modified lines when using `--diff`]:lines'
|
||||
--tabs='[set the tab width]:tab width [4]'
|
||||
--wrap='[specify the text-wrapping mode]:mode [auto]:(auto never character)'
|
||||
'!(--wrap)'{-S,--chop-long-lines}
|
||||
--terminal-width='[explicitly set the width of the terminal instead of determining it automatically]:width'
|
||||
'(-n --number --diff --diff-context)'{-n,--number}'[show line numbers]'
|
||||
--color='[specify when to use colors]:when:(auto never always)'
|
||||
--italic-text='[use italics in output]:when:(always never)'
|
||||
--decorations='[specify when to show the decorations]:when:(auto never always)'
|
||||
--paging='[specify when to use the pager]:when:(auto never always)'
|
||||
'(-m --map-syntax)'{-m+,--map-syntax=}'[map a glob pattern to an existing syntax name]: :->syntax-maps'
|
||||
'(--theme)'--theme='[set the color theme for syntax highlighting]:theme:->theme_preferences'
|
||||
'(--theme-dark)'--theme-dark='[set the color theme for syntax highlighting for dark backgrounds]:theme:->themes'
|
||||
'(--theme-light)'--theme-light='[set the color theme for syntax highlighting for light backgrounds]:theme:->themes'
|
||||
'(: --list-themes --list-languages -L)'--list-themes'[show all supported highlighting themes]'
|
||||
--style='[comma-separated list of style elements to display]: : _values "style [default]"
|
||||
default auto full plain changes header header-filename header-filesize grid rule numbers snip'
|
||||
\*{-r+,--line-range=}'[only print the specified line range]:start\:end'
|
||||
'(* -)'{-L,--list-languages}'[display all supported languages]'
|
||||
-P'[disable paging]'
|
||||
"--no-config[don't use the configuration file]"
|
||||
"--no-custom-assets[don't load custom assets]"
|
||||
'(--no-lessopen)'--lessopen'[enable the $LESSOPEN preprocessor]'
|
||||
'(--lessopen)'--no-lessopen'[disable the $LESSOPEN preprocessor if enabled (overrides --lessopen)]'
|
||||
'(* -)'--config-dir"[show bat's configuration directory]"
|
||||
'(* -)'--config-file'[show path to the configuration file]'
|
||||
'(* -)'--generate-config-file'[generate a default configuration file]'
|
||||
'(* -)'--cache-dir"[show bat's cache directory]"
|
||||
'(* -)'{-h,--help}'[show help information]'
|
||||
'(* -)'{-V,--version}'[show version information]'
|
||||
'*: :{ _files || compadd cache }'
|
||||
)
|
||||
|
||||
_arguments -S -s $args && ret=0
|
||||
|
||||
case "$state" in
|
||||
syntax-maps)
|
||||
if ! compset -P '*:'; then
|
||||
_message -e patterns 'glob pattern:language'
|
||||
return
|
||||
fi
|
||||
;& # fall-through
|
||||
|
||||
languages)
|
||||
local IFS=$'\n'
|
||||
local -a languages
|
||||
languages=( $(bat --list-languages | awk -F':|,' '{ for (i = 1; i <= NF; ++i) printf("%s:%s\n", $i, $1) }') )
|
||||
|
||||
_describe 'language' languages && ret=0
|
||||
;;
|
||||
|
||||
themes)
|
||||
local -a themes expl
|
||||
themes=(${(f)"$(_call_program themes bat --list-themes)"} )
|
||||
|
||||
_wanted themes expl 'theme' compadd -a themes && ret=0
|
||||
;;
|
||||
theme_preferences)
|
||||
local -a themes expl
|
||||
themes=(auto dark light auto:always auto:system ${(f)"$(_call_program themes bat --list-themes)"} )
|
||||
|
||||
_wanted themes expl 'theme' compadd -a themes && ret=0
|
||||
;;
|
||||
esac
|
||||
|
||||
return ret
|
||||
}
|
||||
|
||||
case $words[2] in
|
||||
cache)
|
||||
## Completion of the 'cache' command itself is removed for better UX
|
||||
## See https://github.com/sharkdp/bat/issues/2085#issuecomment-1271646802
|
||||
shift words
|
||||
(( CURRENT-- ))
|
||||
curcontext="${curcontext%:*}-${words[1]}:"
|
||||
_bat_cache_subcommand
|
||||
;;
|
||||
|
||||
*)
|
||||
_bat_main
|
||||
;;
|
||||
esac
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
355
config/zsh/completions/_leptos
Normal file
355
config/zsh/completions/_leptos
Normal file
@@ -0,0 +1,355 @@
|
||||
#compdef cargo-leptos
|
||||
|
||||
autoload -U is-at-least
|
||||
|
||||
_cargo-leptos() {
|
||||
typeset -A opt_args
|
||||
typeset -a _arguments_options
|
||||
local ret=1
|
||||
|
||||
if is-at-least 5.2; then
|
||||
_arguments_options=(-s -S -C)
|
||||
else
|
||||
_arguments_options=(-s -C)
|
||||
fi
|
||||
|
||||
local context curcontext="$curcontext" state line
|
||||
_arguments "${_arguments_options[@]}" : \
|
||||
'--manifest-path=[Path to Cargo.toml]:MANIFEST_PATH:_default' \
|
||||
'*--log=[Output logs from dependencies (multiple --log accepted)]:LOG:((wasm\:"WASM build (wasm, wasm-opt, walrus)"
|
||||
server\:"Internal reload and csr server (hyper, axum)"))' \
|
||||
'-h[Print help (see more with '\''--help'\'')]' \
|
||||
'--help[Print help (see more with '\''--help'\'')]' \
|
||||
'-V[Print version]' \
|
||||
'--version[Print version]' \
|
||||
":: :_cargo-leptos_commands" \
|
||||
"*::: :->cargo-leptos" \
|
||||
&& ret=0
|
||||
case $state in
|
||||
(cargo-leptos)
|
||||
words=($line[1] "${words[@]}")
|
||||
(( CURRENT += 1 ))
|
||||
curcontext="${curcontext%:*:*}:cargo-leptos-command-$line[1]:"
|
||||
case $line[1] in
|
||||
(build)
|
||||
_arguments "${_arguments_options[@]}" : \
|
||||
'-p+[Which project to use, from a list of projects defined in a workspace]:PROJECT:_default' \
|
||||
'--project=[Which project to use, from a list of projects defined in a workspace]:PROJECT:_default' \
|
||||
'*--features=[The features to use when compiling all targets]:FEATURES:_default' \
|
||||
'*--lib-features=[The features to use when compiling the lib target]:LIB_FEATURES:_default' \
|
||||
'*--lib-cargo-args=[The cargo flags to pass to cargo when compiling the lib target]:LIB_CARGO_ARGS:_default' \
|
||||
'*--bin-features=[The features to use when compiling the bin target]:BIN_FEATURES:_default' \
|
||||
'*--bin-cargo-args=[The cargo flags to pass to cargo when compiling the bin target]:BIN_CARGO_ARGS:_default' \
|
||||
'--js-minify=[Minify javascript assets with swc. Applies to release builds only]:JS_MINIFY:(true false)' \
|
||||
'-r[Build artifacts in release mode, with optimizations]' \
|
||||
'--release[Build artifacts in release mode, with optimizations]' \
|
||||
'-P[Precompress static assets with gzip and brotli. Applies to release builds only]' \
|
||||
'--precompress[Precompress static assets with gzip and brotli. Applies to release builds only]' \
|
||||
'--hot-reload[Turn on partial hot-reloading. Requires rust nightly \[beta\]]' \
|
||||
'--wasm-debug[Include debug information in Wasm output. Includes source maps and DWARF debug info]' \
|
||||
'*-v[Verbosity (none\: info, errors & warnings, -v\: verbose, -vv\: very verbose)]' \
|
||||
'-c[Clear the terminal before rebuilding]' \
|
||||
'--clear[Clear the terminal before rebuilding]' \
|
||||
'--split[Split WASM binary based on #\[lazy\] macros]' \
|
||||
'--frontend-only[Only build the frontend]' \
|
||||
'(--frontend-only)--server-only[Only build the server]' \
|
||||
'-h[Print help]' \
|
||||
'--help[Print help]' \
|
||||
&& ret=0
|
||||
;;
|
||||
(test)
|
||||
_arguments "${_arguments_options[@]}" : \
|
||||
'-p+[Which project to use, from a list of projects defined in a workspace]:PROJECT:_default' \
|
||||
'--project=[Which project to use, from a list of projects defined in a workspace]:PROJECT:_default' \
|
||||
'*--features=[The features to use when compiling all targets]:FEATURES:_default' \
|
||||
'*--lib-features=[The features to use when compiling the lib target]:LIB_FEATURES:_default' \
|
||||
'*--lib-cargo-args=[The cargo flags to pass to cargo when compiling the lib target]:LIB_CARGO_ARGS:_default' \
|
||||
'*--bin-features=[The features to use when compiling the bin target]:BIN_FEATURES:_default' \
|
||||
'*--bin-cargo-args=[The cargo flags to pass to cargo when compiling the bin target]:BIN_CARGO_ARGS:_default' \
|
||||
'--js-minify=[Minify javascript assets with swc. Applies to release builds only]:JS_MINIFY:(true false)' \
|
||||
'-r[Build artifacts in release mode, with optimizations]' \
|
||||
'--release[Build artifacts in release mode, with optimizations]' \
|
||||
'-P[Precompress static assets with gzip and brotli. Applies to release builds only]' \
|
||||
'--precompress[Precompress static assets with gzip and brotli. Applies to release builds only]' \
|
||||
'--hot-reload[Turn on partial hot-reloading. Requires rust nightly \[beta\]]' \
|
||||
'--wasm-debug[Include debug information in Wasm output. Includes source maps and DWARF debug info]' \
|
||||
'*-v[Verbosity (none\: info, errors & warnings, -v\: verbose, -vv\: very verbose)]' \
|
||||
'-c[Clear the terminal before rebuilding]' \
|
||||
'--clear[Clear the terminal before rebuilding]' \
|
||||
'--split[Split WASM binary based on #\[lazy\] macros]' \
|
||||
'--frontend-only[Only build the frontend]' \
|
||||
'(--frontend-only)--server-only[Only build the server]' \
|
||||
'-h[Print help]' \
|
||||
'--help[Print help]' \
|
||||
&& ret=0
|
||||
;;
|
||||
(end-to-end)
|
||||
_arguments "${_arguments_options[@]}" : \
|
||||
'-p+[Which project to use, from a list of projects defined in a workspace]:PROJECT:_default' \
|
||||
'--project=[Which project to use, from a list of projects defined in a workspace]:PROJECT:_default' \
|
||||
'*--features=[The features to use when compiling all targets]:FEATURES:_default' \
|
||||
'*--lib-features=[The features to use when compiling the lib target]:LIB_FEATURES:_default' \
|
||||
'*--lib-cargo-args=[The cargo flags to pass to cargo when compiling the lib target]:LIB_CARGO_ARGS:_default' \
|
||||
'*--bin-features=[The features to use when compiling the bin target]:BIN_FEATURES:_default' \
|
||||
'*--bin-cargo-args=[The cargo flags to pass to cargo when compiling the bin target]:BIN_CARGO_ARGS:_default' \
|
||||
'--js-minify=[Minify javascript assets with swc. Applies to release builds only]:JS_MINIFY:(true false)' \
|
||||
'-r[Build artifacts in release mode, with optimizations]' \
|
||||
'--release[Build artifacts in release mode, with optimizations]' \
|
||||
'-P[Precompress static assets with gzip and brotli. Applies to release builds only]' \
|
||||
'--precompress[Precompress static assets with gzip and brotli. Applies to release builds only]' \
|
||||
'--hot-reload[Turn on partial hot-reloading. Requires rust nightly \[beta\]]' \
|
||||
'--wasm-debug[Include debug information in Wasm output. Includes source maps and DWARF debug info]' \
|
||||
'*-v[Verbosity (none\: info, errors & warnings, -v\: verbose, -vv\: very verbose)]' \
|
||||
'-c[Clear the terminal before rebuilding]' \
|
||||
'--clear[Clear the terminal before rebuilding]' \
|
||||
'--split[Split WASM binary based on #\[lazy\] macros]' \
|
||||
'--frontend-only[Only build the frontend]' \
|
||||
'(--frontend-only)--server-only[Only build the server]' \
|
||||
'-h[Print help]' \
|
||||
'--help[Print help]' \
|
||||
&& ret=0
|
||||
;;
|
||||
(serve)
|
||||
_arguments "${_arguments_options[@]}" : \
|
||||
'-p+[Which project to use, from a list of projects defined in a workspace]:PROJECT:_default' \
|
||||
'--project=[Which project to use, from a list of projects defined in a workspace]:PROJECT:_default' \
|
||||
'*--features=[The features to use when compiling all targets]:FEATURES:_default' \
|
||||
'*--lib-features=[The features to use when compiling the lib target]:LIB_FEATURES:_default' \
|
||||
'*--lib-cargo-args=[The cargo flags to pass to cargo when compiling the lib target]:LIB_CARGO_ARGS:_default' \
|
||||
'*--bin-features=[The features to use when compiling the bin target]:BIN_FEATURES:_default' \
|
||||
'*--bin-cargo-args=[The cargo flags to pass to cargo when compiling the bin target]:BIN_CARGO_ARGS:_default' \
|
||||
'--js-minify=[Minify javascript assets with swc. Applies to release builds only]:JS_MINIFY:(true false)' \
|
||||
'-r[Build artifacts in release mode, with optimizations]' \
|
||||
'--release[Build artifacts in release mode, with optimizations]' \
|
||||
'-P[Precompress static assets with gzip and brotli. Applies to release builds only]' \
|
||||
'--precompress[Precompress static assets with gzip and brotli. Applies to release builds only]' \
|
||||
'--hot-reload[Turn on partial hot-reloading. Requires rust nightly \[beta\]]' \
|
||||
'--wasm-debug[Include debug information in Wasm output. Includes source maps and DWARF debug info]' \
|
||||
'*-v[Verbosity (none\: info, errors & warnings, -v\: verbose, -vv\: very verbose)]' \
|
||||
'-c[Clear the terminal before rebuilding]' \
|
||||
'--clear[Clear the terminal before rebuilding]' \
|
||||
'--split[Split WASM binary based on #\[lazy\] macros]' \
|
||||
'--frontend-only[Only build the frontend]' \
|
||||
'(--frontend-only)--server-only[Only build the server]' \
|
||||
'-h[Print help]' \
|
||||
'--help[Print help]' \
|
||||
'*::bin_args:_default' \
|
||||
&& ret=0
|
||||
;;
|
||||
(watch)
|
||||
_arguments "${_arguments_options[@]}" : \
|
||||
'-p+[Which project to use, from a list of projects defined in a workspace]:PROJECT:_default' \
|
||||
'--project=[Which project to use, from a list of projects defined in a workspace]:PROJECT:_default' \
|
||||
'*--features=[The features to use when compiling all targets]:FEATURES:_default' \
|
||||
'*--lib-features=[The features to use when compiling the lib target]:LIB_FEATURES:_default' \
|
||||
'*--lib-cargo-args=[The cargo flags to pass to cargo when compiling the lib target]:LIB_CARGO_ARGS:_default' \
|
||||
'*--bin-features=[The features to use when compiling the bin target]:BIN_FEATURES:_default' \
|
||||
'*--bin-cargo-args=[The cargo flags to pass to cargo when compiling the bin target]:BIN_CARGO_ARGS:_default' \
|
||||
'--js-minify=[Minify javascript assets with swc. Applies to release builds only]:JS_MINIFY:(true false)' \
|
||||
'-r[Build artifacts in release mode, with optimizations]' \
|
||||
'--release[Build artifacts in release mode, with optimizations]' \
|
||||
'-P[Precompress static assets with gzip and brotli. Applies to release builds only]' \
|
||||
'--precompress[Precompress static assets with gzip and brotli. Applies to release builds only]' \
|
||||
'--hot-reload[Turn on partial hot-reloading. Requires rust nightly \[beta\]]' \
|
||||
'--wasm-debug[Include debug information in Wasm output. Includes source maps and DWARF debug info]' \
|
||||
'*-v[Verbosity (none\: info, errors & warnings, -v\: verbose, -vv\: very verbose)]' \
|
||||
'-c[Clear the terminal before rebuilding]' \
|
||||
'--clear[Clear the terminal before rebuilding]' \
|
||||
'--split[Split WASM binary based on #\[lazy\] macros]' \
|
||||
'--frontend-only[Only build the frontend]' \
|
||||
'(--frontend-only)--server-only[Only build the server]' \
|
||||
'-h[Print help]' \
|
||||
'--help[Print help]' \
|
||||
'*::bin_args:_default' \
|
||||
&& ret=0
|
||||
;;
|
||||
(new)
|
||||
_arguments "${_arguments_options[@]}" : \
|
||||
'-g+[Git repository to clone template from. Can be a full URL (like \`https\://github.com/leptos-rs/start\`), or a shortcut for one of our built-in templates\: \`leptos-rs/start\`, \`leptos-rs/start-axum\`, \`leptos-rs/start-axum-workspace\`, or \`leptos-rs/start-aws\`]:GIT:_default' \
|
||||
'--git=[Git repository to clone template from. Can be a full URL (like \`https\://github.com/leptos-rs/start\`), or a shortcut for one of our built-in templates\: \`leptos-rs/start\`, \`leptos-rs/start-axum\`, \`leptos-rs/start-axum-workspace\`, or \`leptos-rs/start-aws\`]:GIT:_default' \
|
||||
'(-t --tag)-b+[Branch to use when installing from git]:BRANCH:_default' \
|
||||
'(-t --tag)--branch=[Branch to use when installing from git]:BRANCH:_default' \
|
||||
'(-b --branch)-t+[Tag to use when installing from git]:TAG:_default' \
|
||||
'(-b --branch)--tag=[Tag to use when installing from git]:TAG:_default' \
|
||||
'-p+[Local path to copy the template from. Can not be specified together with --git]:PATH:_default' \
|
||||
'--path=[Local path to copy the template from. Can not be specified together with --git]:PATH:_default' \
|
||||
'-n+[Directory to create / project name; if the name isn'\''t in kebab-case, it will be converted to kebab-case unless \`--force\` is given]:NAME:_default' \
|
||||
'--name=[Directory to create / project name; if the name isn'\''t in kebab-case, it will be converted to kebab-case unless \`--force\` is given]:NAME:_default' \
|
||||
'-f[Don'\''t convert the project name to kebab-case before creating the directory. Note that cargo generate won'\''t overwrite an existing directory, even if \`--force\` is given]' \
|
||||
'--force[Don'\''t convert the project name to kebab-case before creating the directory. Note that cargo generate won'\''t overwrite an existing directory, even if \`--force\` is given]' \
|
||||
'-v[Enables more verbose output]' \
|
||||
'--verbose[Enables more verbose output]' \
|
||||
'--init[Generate the template directly into the current dir. No subfolder will be created and no vcs is initialized]' \
|
||||
'-h[Print help]' \
|
||||
'--help[Print help]' \
|
||||
&& ret=0
|
||||
;;
|
||||
(completions)
|
||||
_arguments "${_arguments_options[@]}" : \
|
||||
'-h[Print help]' \
|
||||
'--help[Print help]' \
|
||||
':shell:(bash elvish fish powershell zsh)' \
|
||||
&& ret=0
|
||||
;;
|
||||
(help)
|
||||
_arguments "${_arguments_options[@]}" : \
|
||||
":: :_cargo-leptos__help_commands" \
|
||||
"*::: :->help" \
|
||||
&& ret=0
|
||||
|
||||
case $state in
|
||||
(help)
|
||||
words=($line[1] "${words[@]}")
|
||||
(( CURRENT += 1 ))
|
||||
curcontext="${curcontext%:*:*}:cargo-leptos-help-command-$line[1]:"
|
||||
case $line[1] in
|
||||
(build)
|
||||
_arguments "${_arguments_options[@]}" : \
|
||||
&& ret=0
|
||||
;;
|
||||
(test)
|
||||
_arguments "${_arguments_options[@]}" : \
|
||||
&& ret=0
|
||||
;;
|
||||
(end-to-end)
|
||||
_arguments "${_arguments_options[@]}" : \
|
||||
&& ret=0
|
||||
;;
|
||||
(serve)
|
||||
_arguments "${_arguments_options[@]}" : \
|
||||
&& ret=0
|
||||
;;
|
||||
(watch)
|
||||
_arguments "${_arguments_options[@]}" : \
|
||||
&& ret=0
|
||||
;;
|
||||
(new)
|
||||
_arguments "${_arguments_options[@]}" : \
|
||||
&& ret=0
|
||||
;;
|
||||
(completions)
|
||||
_arguments "${_arguments_options[@]}" : \
|
||||
&& ret=0
|
||||
;;
|
||||
(help)
|
||||
_arguments "${_arguments_options[@]}" : \
|
||||
&& ret=0
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
(( $+functions[_cargo-leptos_commands] )) ||
|
||||
_cargo-leptos_commands() {
|
||||
local commands; commands=(
|
||||
'build:Build the server (feature ssr) and the client (wasm with feature hydrate)' \
|
||||
'test:Run the cargo tests for app, client and server' \
|
||||
'end-to-end:Start the server and end-2-end tests' \
|
||||
'serve:Serve. Defaults to hydrate mode' \
|
||||
'watch:Serve and automatically reload when files change' \
|
||||
'new:Start a wizard for creating a new project (using cargo-generate)' \
|
||||
'completions:Generate shell for \`cargo-leptos\`' \
|
||||
'help:Print this message or the help of the given subcommand(s)' \
|
||||
)
|
||||
_describe -t commands 'cargo-leptos commands' commands "$@"
|
||||
}
|
||||
(( $+functions[_cargo-leptos__build_commands] )) ||
|
||||
_cargo-leptos__build_commands() {
|
||||
local commands; commands=()
|
||||
_describe -t commands 'cargo-leptos build commands' commands "$@"
|
||||
}
|
||||
(( $+functions[_cargo-leptos__completions_commands] )) ||
|
||||
_cargo-leptos__completions_commands() {
|
||||
local commands; commands=()
|
||||
_describe -t commands 'cargo-leptos completions commands' commands "$@"
|
||||
}
|
||||
(( $+functions[_cargo-leptos__end-to-end_commands] )) ||
|
||||
_cargo-leptos__end-to-end_commands() {
|
||||
local commands; commands=()
|
||||
_describe -t commands 'cargo-leptos end-to-end commands' commands "$@"
|
||||
}
|
||||
(( $+functions[_cargo-leptos__help_commands] )) ||
|
||||
_cargo-leptos__help_commands() {
|
||||
local commands; commands=(
|
||||
'build:Build the server (feature ssr) and the client (wasm with feature hydrate)' \
|
||||
'test:Run the cargo tests for app, client and server' \
|
||||
'end-to-end:Start the server and end-2-end tests' \
|
||||
'serve:Serve. Defaults to hydrate mode' \
|
||||
'watch:Serve and automatically reload when files change' \
|
||||
'new:Start a wizard for creating a new project (using cargo-generate)' \
|
||||
'completions:Generate shell for \`cargo-leptos\`' \
|
||||
'help:Print this message or the help of the given subcommand(s)' \
|
||||
)
|
||||
_describe -t commands 'cargo-leptos help commands' commands "$@"
|
||||
}
|
||||
(( $+functions[_cargo-leptos__help__build_commands] )) ||
|
||||
_cargo-leptos__help__build_commands() {
|
||||
local commands; commands=()
|
||||
_describe -t commands 'cargo-leptos help build commands' commands "$@"
|
||||
}
|
||||
(( $+functions[_cargo-leptos__help__completions_commands] )) ||
|
||||
_cargo-leptos__help__completions_commands() {
|
||||
local commands; commands=()
|
||||
_describe -t commands 'cargo-leptos help completions commands' commands "$@"
|
||||
}
|
||||
(( $+functions[_cargo-leptos__help__end-to-end_commands] )) ||
|
||||
_cargo-leptos__help__end-to-end_commands() {
|
||||
local commands; commands=()
|
||||
_describe -t commands 'cargo-leptos help end-to-end commands' commands "$@"
|
||||
}
|
||||
(( $+functions[_cargo-leptos__help__help_commands] )) ||
|
||||
_cargo-leptos__help__help_commands() {
|
||||
local commands; commands=()
|
||||
_describe -t commands 'cargo-leptos help help commands' commands "$@"
|
||||
}
|
||||
(( $+functions[_cargo-leptos__help__new_commands] )) ||
|
||||
_cargo-leptos__help__new_commands() {
|
||||
local commands; commands=()
|
||||
_describe -t commands 'cargo-leptos help new commands' commands "$@"
|
||||
}
|
||||
(( $+functions[_cargo-leptos__help__serve_commands] )) ||
|
||||
_cargo-leptos__help__serve_commands() {
|
||||
local commands; commands=()
|
||||
_describe -t commands 'cargo-leptos help serve commands' commands "$@"
|
||||
}
|
||||
(( $+functions[_cargo-leptos__help__test_commands] )) ||
|
||||
_cargo-leptos__help__test_commands() {
|
||||
local commands; commands=()
|
||||
_describe -t commands 'cargo-leptos help test commands' commands "$@"
|
||||
}
|
||||
(( $+functions[_cargo-leptos__help__watch_commands] )) ||
|
||||
_cargo-leptos__help__watch_commands() {
|
||||
local commands; commands=()
|
||||
_describe -t commands 'cargo-leptos help watch commands' commands "$@"
|
||||
}
|
||||
(( $+functions[_cargo-leptos__new_commands] )) ||
|
||||
_cargo-leptos__new_commands() {
|
||||
local commands; commands=()
|
||||
_describe -t commands 'cargo-leptos new commands' commands "$@"
|
||||
}
|
||||
(( $+functions[_cargo-leptos__serve_commands] )) ||
|
||||
_cargo-leptos__serve_commands() {
|
||||
local commands; commands=()
|
||||
_describe -t commands 'cargo-leptos serve commands' commands "$@"
|
||||
}
|
||||
(( $+functions[_cargo-leptos__test_commands] )) ||
|
||||
_cargo-leptos__test_commands() {
|
||||
local commands; commands=()
|
||||
_describe -t commands 'cargo-leptos test commands' commands "$@"
|
||||
}
|
||||
(( $+functions[_cargo-leptos__watch_commands] )) ||
|
||||
_cargo-leptos__watch_commands() {
|
||||
local commands; commands=()
|
||||
_describe -t commands 'cargo-leptos watch commands' commands "$@"
|
||||
}
|
||||
|
||||
if [ "$funcstack[1]" = "_cargo-leptos" ]; then
|
||||
_cargo-leptos "$@"
|
||||
else
|
||||
compdef _cargo-leptos cargo-leptos
|
||||
fi
|
||||
@@ -1,635 +0,0 @@
|
||||
#compdef sqlx
|
||||
|
||||
autoload -U is-at-least
|
||||
|
||||
_sqlx() {
|
||||
typeset -A opt_args
|
||||
typeset -a _arguments_options
|
||||
local ret=1
|
||||
|
||||
if is-at-least 5.2; then
|
||||
_arguments_options=(-s -S -C)
|
||||
else
|
||||
_arguments_options=(-s -C)
|
||||
fi
|
||||
|
||||
local context curcontext="$curcontext" state line
|
||||
_arguments "${_arguments_options[@]}" : \
|
||||
'-h[Print help]' \
|
||||
'--help[Print help]' \
|
||||
":: :_sqlx_commands" \
|
||||
"*::: :->sqlx-cli" \
|
||||
&& ret=0
|
||||
case $state in
|
||||
(sqlx-cli)
|
||||
words=($line[1] "${words[@]}")
|
||||
(( CURRENT += 1 ))
|
||||
curcontext="${curcontext%:*:*}:sqlx-command-$line[1]:"
|
||||
case $line[1] in
|
||||
(database)
|
||||
_arguments "${_arguments_options[@]}" : \
|
||||
'-h[Print help]' \
|
||||
'--help[Print help]' \
|
||||
":: :_sqlx__database_commands" \
|
||||
"*::: :->database" \
|
||||
&& ret=0
|
||||
|
||||
case $state in
|
||||
(database)
|
||||
words=($line[1] "${words[@]}")
|
||||
(( CURRENT += 1 ))
|
||||
curcontext="${curcontext%:*:*}:sqlx-database-command-$line[1]:"
|
||||
case $line[1] in
|
||||
(create)
|
||||
_arguments "${_arguments_options[@]}" : \
|
||||
'-D+[Location of the DB, by default will be read from the DATABASE_URL env var or \`.env\` files]:DATABASE_URL:_default' \
|
||||
'--database-url=[Location of the DB, by default will be read from the DATABASE_URL env var or \`.env\` files]:DATABASE_URL:_default' \
|
||||
'--connect-timeout=[The maximum time, in seconds, to try connecting to the database server before returning an error]:CONNECT_TIMEOUT:_default' \
|
||||
'--no-dotenv[Do not automatically load \`.env\` files]' \
|
||||
'-h[Print help]' \
|
||||
'--help[Print help]' \
|
||||
&& ret=0
|
||||
;;
|
||||
(drop)
|
||||
_arguments "${_arguments_options[@]}" : \
|
||||
'-D+[Location of the DB, by default will be read from the DATABASE_URL env var or \`.env\` files]:DATABASE_URL:_default' \
|
||||
'--database-url=[Location of the DB, by default will be read from the DATABASE_URL env var or \`.env\` files]:DATABASE_URL:_default' \
|
||||
'--connect-timeout=[The maximum time, in seconds, to try connecting to the database server before returning an error]:CONNECT_TIMEOUT:_default' \
|
||||
'-y[Automatic confirmation. Without this option, you will be prompted before dropping your database]' \
|
||||
'--no-dotenv[Do not automatically load \`.env\` files]' \
|
||||
'-f[PostgreSQL only\: force drops the database]' \
|
||||
'--force[PostgreSQL only\: force drops the database]' \
|
||||
'-h[Print help]' \
|
||||
'--help[Print help]' \
|
||||
&& ret=0
|
||||
;;
|
||||
(reset)
|
||||
_arguments "${_arguments_options[@]}" : \
|
||||
'--source=[Path to folder containing migrations]:SOURCE:_default' \
|
||||
'-D+[Location of the DB, by default will be read from the DATABASE_URL env var or \`.env\` files]:DATABASE_URL:_default' \
|
||||
'--database-url=[Location of the DB, by default will be read from the DATABASE_URL env var or \`.env\` files]:DATABASE_URL:_default' \
|
||||
'--connect-timeout=[The maximum time, in seconds, to try connecting to the database server before returning an error]:CONNECT_TIMEOUT:_default' \
|
||||
'-y[Automatic confirmation. Without this option, you will be prompted before dropping your database]' \
|
||||
'--no-dotenv[Do not automatically load \`.env\` files]' \
|
||||
'-f[PostgreSQL only\: force drops the database]' \
|
||||
'--force[PostgreSQL only\: force drops the database]' \
|
||||
'-h[Print help]' \
|
||||
'--help[Print help]' \
|
||||
&& ret=0
|
||||
;;
|
||||
(setup)
|
||||
_arguments "${_arguments_options[@]}" : \
|
||||
'--source=[Path to folder containing migrations]:SOURCE:_default' \
|
||||
'-D+[Location of the DB, by default will be read from the DATABASE_URL env var or \`.env\` files]:DATABASE_URL:_default' \
|
||||
'--database-url=[Location of the DB, by default will be read from the DATABASE_URL env var or \`.env\` files]:DATABASE_URL:_default' \
|
||||
'--connect-timeout=[The maximum time, in seconds, to try connecting to the database server before returning an error]:CONNECT_TIMEOUT:_default' \
|
||||
'--no-dotenv[Do not automatically load \`.env\` files]' \
|
||||
'-h[Print help]' \
|
||||
'--help[Print help]' \
|
||||
&& ret=0
|
||||
;;
|
||||
(help)
|
||||
_arguments "${_arguments_options[@]}" : \
|
||||
":: :_sqlx__database__help_commands" \
|
||||
"*::: :->help" \
|
||||
&& ret=0
|
||||
|
||||
case $state in
|
||||
(help)
|
||||
words=($line[1] "${words[@]}")
|
||||
(( CURRENT += 1 ))
|
||||
curcontext="${curcontext%:*:*}:sqlx-database-help-command-$line[1]:"
|
||||
case $line[1] in
|
||||
(create)
|
||||
_arguments "${_arguments_options[@]}" : \
|
||||
&& ret=0
|
||||
;;
|
||||
(drop)
|
||||
_arguments "${_arguments_options[@]}" : \
|
||||
&& ret=0
|
||||
;;
|
||||
(reset)
|
||||
_arguments "${_arguments_options[@]}" : \
|
||||
&& ret=0
|
||||
;;
|
||||
(setup)
|
||||
_arguments "${_arguments_options[@]}" : \
|
||||
&& ret=0
|
||||
;;
|
||||
(help)
|
||||
_arguments "${_arguments_options[@]}" : \
|
||||
&& ret=0
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
(prepare)
|
||||
_arguments "${_arguments_options[@]}" : \
|
||||
'-D+[Location of the DB, by default will be read from the DATABASE_URL env var or \`.env\` files]:DATABASE_URL:_default' \
|
||||
'--database-url=[Location of the DB, by default will be read from the DATABASE_URL env var or \`.env\` files]:DATABASE_URL:_default' \
|
||||
'--connect-timeout=[The maximum time, in seconds, to try connecting to the database server before returning an error]:CONNECT_TIMEOUT:_default' \
|
||||
'--check[Run in '\''check'\'' mode. Exits with 0 if the query metadata is up-to-date. Exits with 1 if the query metadata needs updating]' \
|
||||
'--all[Prepare query macros in dependencies that exist outside the current crate or workspace]' \
|
||||
'--workspace[Generate a single workspace-level \`.sqlx\` folder]' \
|
||||
'--no-dotenv[Do not automatically load \`.env\` files]' \
|
||||
'-h[Print help (see more with '\''--help'\'')]' \
|
||||
'--help[Print help (see more with '\''--help'\'')]' \
|
||||
'*::args -- Arguments to be passed to `cargo rustc ...`:_default' \
|
||||
&& ret=0
|
||||
;;
|
||||
(migrate)
|
||||
_arguments "${_arguments_options[@]}" : \
|
||||
'-h[Print help]' \
|
||||
'--help[Print help]' \
|
||||
":: :_sqlx__migrate_commands" \
|
||||
"*::: :->migrate" \
|
||||
&& ret=0
|
||||
|
||||
case $state in
|
||||
(migrate)
|
||||
words=($line[1] "${words[@]}")
|
||||
(( CURRENT += 1 ))
|
||||
curcontext="${curcontext%:*:*}:sqlx-migrate-command-$line[1]:"
|
||||
case $line[1] in
|
||||
(add)
|
||||
_arguments "${_arguments_options[@]}" : \
|
||||
'--source=[Path to folder containing migrations]:SOURCE:_default' \
|
||||
'-r[If true, creates a pair of up and down migration files with same version else creates a single sql file]' \
|
||||
'-t[If set, use timestamp versioning for the new migration. Conflicts with \`--sequential\`]' \
|
||||
'--timestamp[If set, use timestamp versioning for the new migration. Conflicts with \`--sequential\`]' \
|
||||
'(-t --timestamp)-s[If set, use sequential versioning for the new migration. Conflicts with \`--timestamp\`]' \
|
||||
'(-t --timestamp)--sequential[If set, use sequential versioning for the new migration. Conflicts with \`--timestamp\`]' \
|
||||
'-h[Print help (see more with '\''--help'\'')]' \
|
||||
'--help[Print help (see more with '\''--help'\'')]' \
|
||||
':description:_default' \
|
||||
&& ret=0
|
||||
;;
|
||||
(run)
|
||||
_arguments "${_arguments_options[@]}" : \
|
||||
'--source=[Path to folder containing migrations]:SOURCE:_default' \
|
||||
'-D+[Location of the DB, by default will be read from the DATABASE_URL env var or \`.env\` files]:DATABASE_URL:_default' \
|
||||
'--database-url=[Location of the DB, by default will be read from the DATABASE_URL env var or \`.env\` files]:DATABASE_URL:_default' \
|
||||
'--connect-timeout=[The maximum time, in seconds, to try connecting to the database server before returning an error]:CONNECT_TIMEOUT:_default' \
|
||||
'--target-version=[Apply migrations up to the specified version. If unspecified, apply all pending migrations. If already at the target version, then no-op]:TARGET_VERSION:_default' \
|
||||
'--dry-run[List all the migrations to be run without applying]' \
|
||||
'--ignore-missing[Ignore applied migrations that are missing in the resolved migrations]' \
|
||||
'--no-dotenv[Do not automatically load \`.env\` files]' \
|
||||
'-h[Print help]' \
|
||||
'--help[Print help]' \
|
||||
&& ret=0
|
||||
;;
|
||||
(revert)
|
||||
_arguments "${_arguments_options[@]}" : \
|
||||
'--source=[Path to folder containing migrations]:SOURCE:_default' \
|
||||
'-D+[Location of the DB, by default will be read from the DATABASE_URL env var or \`.env\` files]:DATABASE_URL:_default' \
|
||||
'--database-url=[Location of the DB, by default will be read from the DATABASE_URL env var or \`.env\` files]:DATABASE_URL:_default' \
|
||||
'--connect-timeout=[The maximum time, in seconds, to try connecting to the database server before returning an error]:CONNECT_TIMEOUT:_default' \
|
||||
'--target-version=[Revert migrations down to the specified version. If unspecified, revert only the last migration. Set to 0 to revert all migrations. If already at the target version, then no-op]:TARGET_VERSION:_default' \
|
||||
'--dry-run[List the migration to be reverted without applying]' \
|
||||
'--ignore-missing[Ignore applied migrations that are missing in the resolved migrations]' \
|
||||
'--no-dotenv[Do not automatically load \`.env\` files]' \
|
||||
'-h[Print help]' \
|
||||
'--help[Print help]' \
|
||||
&& ret=0
|
||||
;;
|
||||
(info)
|
||||
_arguments "${_arguments_options[@]}" : \
|
||||
'--source=[Path to folder containing migrations]:SOURCE:_default' \
|
||||
'-D+[Location of the DB, by default will be read from the DATABASE_URL env var or \`.env\` files]:DATABASE_URL:_default' \
|
||||
'--database-url=[Location of the DB, by default will be read from the DATABASE_URL env var or \`.env\` files]:DATABASE_URL:_default' \
|
||||
'--connect-timeout=[The maximum time, in seconds, to try connecting to the database server before returning an error]:CONNECT_TIMEOUT:_default' \
|
||||
'--no-dotenv[Do not automatically load \`.env\` files]' \
|
||||
'-h[Print help]' \
|
||||
'--help[Print help]' \
|
||||
&& ret=0
|
||||
;;
|
||||
(build-script)
|
||||
_arguments "${_arguments_options[@]}" : \
|
||||
'--source=[Path to folder containing migrations]:SOURCE:_default' \
|
||||
'--force[Overwrite the build script if it already exists]' \
|
||||
'-h[Print help (see more with '\''--help'\'')]' \
|
||||
'--help[Print help (see more with '\''--help'\'')]' \
|
||||
&& ret=0
|
||||
;;
|
||||
(help)
|
||||
_arguments "${_arguments_options[@]}" : \
|
||||
":: :_sqlx__migrate__help_commands" \
|
||||
"*::: :->help" \
|
||||
&& ret=0
|
||||
|
||||
case $state in
|
||||
(help)
|
||||
words=($line[1] "${words[@]}")
|
||||
(( CURRENT += 1 ))
|
||||
curcontext="${curcontext%:*:*}:sqlx-migrate-help-command-$line[1]:"
|
||||
case $line[1] in
|
||||
(add)
|
||||
_arguments "${_arguments_options[@]}" : \
|
||||
&& ret=0
|
||||
;;
|
||||
(run)
|
||||
_arguments "${_arguments_options[@]}" : \
|
||||
&& ret=0
|
||||
;;
|
||||
(revert)
|
||||
_arguments "${_arguments_options[@]}" : \
|
||||
&& ret=0
|
||||
;;
|
||||
(info)
|
||||
_arguments "${_arguments_options[@]}" : \
|
||||
&& ret=0
|
||||
;;
|
||||
(build-script)
|
||||
_arguments "${_arguments_options[@]}" : \
|
||||
&& ret=0
|
||||
;;
|
||||
(help)
|
||||
_arguments "${_arguments_options[@]}" : \
|
||||
&& ret=0
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
(completions)
|
||||
_arguments "${_arguments_options[@]}" : \
|
||||
'-h[Print help]' \
|
||||
'--help[Print help]' \
|
||||
':shell:(bash elvish fish powershell zsh)' \
|
||||
&& ret=0
|
||||
;;
|
||||
(help)
|
||||
_arguments "${_arguments_options[@]}" : \
|
||||
":: :_sqlx__help_commands" \
|
||||
"*::: :->help" \
|
||||
&& ret=0
|
||||
|
||||
case $state in
|
||||
(help)
|
||||
words=($line[1] "${words[@]}")
|
||||
(( CURRENT += 1 ))
|
||||
curcontext="${curcontext%:*:*}:sqlx-help-command-$line[1]:"
|
||||
case $line[1] in
|
||||
(database)
|
||||
_arguments "${_arguments_options[@]}" : \
|
||||
":: :_sqlx__help__database_commands" \
|
||||
"*::: :->database" \
|
||||
&& ret=0
|
||||
|
||||
case $state in
|
||||
(database)
|
||||
words=($line[1] "${words[@]}")
|
||||
(( CURRENT += 1 ))
|
||||
curcontext="${curcontext%:*:*}:sqlx-help-database-command-$line[1]:"
|
||||
case $line[1] in
|
||||
(create)
|
||||
_arguments "${_arguments_options[@]}" : \
|
||||
&& ret=0
|
||||
;;
|
||||
(drop)
|
||||
_arguments "${_arguments_options[@]}" : \
|
||||
&& ret=0
|
||||
;;
|
||||
(reset)
|
||||
_arguments "${_arguments_options[@]}" : \
|
||||
&& ret=0
|
||||
;;
|
||||
(setup)
|
||||
_arguments "${_arguments_options[@]}" : \
|
||||
&& ret=0
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
(prepare)
|
||||
_arguments "${_arguments_options[@]}" : \
|
||||
&& ret=0
|
||||
;;
|
||||
(migrate)
|
||||
_arguments "${_arguments_options[@]}" : \
|
||||
":: :_sqlx__help__migrate_commands" \
|
||||
"*::: :->migrate" \
|
||||
&& ret=0
|
||||
|
||||
case $state in
|
||||
(migrate)
|
||||
words=($line[1] "${words[@]}")
|
||||
(( CURRENT += 1 ))
|
||||
curcontext="${curcontext%:*:*}:sqlx-help-migrate-command-$line[1]:"
|
||||
case $line[1] in
|
||||
(add)
|
||||
_arguments "${_arguments_options[@]}" : \
|
||||
&& ret=0
|
||||
;;
|
||||
(run)
|
||||
_arguments "${_arguments_options[@]}" : \
|
||||
&& ret=0
|
||||
;;
|
||||
(revert)
|
||||
_arguments "${_arguments_options[@]}" : \
|
||||
&& ret=0
|
||||
;;
|
||||
(info)
|
||||
_arguments "${_arguments_options[@]}" : \
|
||||
&& ret=0
|
||||
;;
|
||||
(build-script)
|
||||
_arguments "${_arguments_options[@]}" : \
|
||||
&& ret=0
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
(completions)
|
||||
_arguments "${_arguments_options[@]}" : \
|
||||
&& ret=0
|
||||
;;
|
||||
(help)
|
||||
_arguments "${_arguments_options[@]}" : \
|
||||
&& ret=0
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
(( $+functions[_sqlx_commands] )) ||
|
||||
_sqlx_commands() {
|
||||
local commands; commands=(
|
||||
'database:Group of commands for creating and dropping your database' \
|
||||
'prepare:Generate query metadata to support offline compile-time verification' \
|
||||
'migrate:Group of commands for creating and running migrations' \
|
||||
'completions:Generate shell completions for the specified shell' \
|
||||
'help:Print this message or the help of the given subcommand(s)' \
|
||||
)
|
||||
_describe -t commands 'sqlx commands' commands "$@"
|
||||
}
|
||||
(( $+functions[_sqlx__completions_commands] )) ||
|
||||
_sqlx__completions_commands() {
|
||||
local commands; commands=()
|
||||
_describe -t commands 'sqlx completions commands' commands "$@"
|
||||
}
|
||||
(( $+functions[_sqlx__database_commands] )) ||
|
||||
_sqlx__database_commands() {
|
||||
local commands; commands=(
|
||||
'create:Creates the database specified in your DATABASE_URL' \
|
||||
'drop:Drops the database specified in your DATABASE_URL' \
|
||||
'reset:Drops the database specified in your DATABASE_URL, re-creates it, and runs any pending migrations' \
|
||||
'setup:Creates the database specified in your DATABASE_URL and runs any pending migrations' \
|
||||
'help:Print this message or the help of the given subcommand(s)' \
|
||||
)
|
||||
_describe -t commands 'sqlx database commands' commands "$@"
|
||||
}
|
||||
(( $+functions[_sqlx__database__create_commands] )) ||
|
||||
_sqlx__database__create_commands() {
|
||||
local commands; commands=()
|
||||
_describe -t commands 'sqlx database create commands' commands "$@"
|
||||
}
|
||||
(( $+functions[_sqlx__database__drop_commands] )) ||
|
||||
_sqlx__database__drop_commands() {
|
||||
local commands; commands=()
|
||||
_describe -t commands 'sqlx database drop commands' commands "$@"
|
||||
}
|
||||
(( $+functions[_sqlx__database__help_commands] )) ||
|
||||
_sqlx__database__help_commands() {
|
||||
local commands; commands=(
|
||||
'create:Creates the database specified in your DATABASE_URL' \
|
||||
'drop:Drops the database specified in your DATABASE_URL' \
|
||||
'reset:Drops the database specified in your DATABASE_URL, re-creates it, and runs any pending migrations' \
|
||||
'setup:Creates the database specified in your DATABASE_URL and runs any pending migrations' \
|
||||
'help:Print this message or the help of the given subcommand(s)' \
|
||||
)
|
||||
_describe -t commands 'sqlx database help commands' commands "$@"
|
||||
}
|
||||
(( $+functions[_sqlx__database__help__create_commands] )) ||
|
||||
_sqlx__database__help__create_commands() {
|
||||
local commands; commands=()
|
||||
_describe -t commands 'sqlx database help create commands' commands "$@"
|
||||
}
|
||||
(( $+functions[_sqlx__database__help__drop_commands] )) ||
|
||||
_sqlx__database__help__drop_commands() {
|
||||
local commands; commands=()
|
||||
_describe -t commands 'sqlx database help drop commands' commands "$@"
|
||||
}
|
||||
(( $+functions[_sqlx__database__help__help_commands] )) ||
|
||||
_sqlx__database__help__help_commands() {
|
||||
local commands; commands=()
|
||||
_describe -t commands 'sqlx database help help commands' commands "$@"
|
||||
}
|
||||
(( $+functions[_sqlx__database__help__reset_commands] )) ||
|
||||
_sqlx__database__help__reset_commands() {
|
||||
local commands; commands=()
|
||||
_describe -t commands 'sqlx database help reset commands' commands "$@"
|
||||
}
|
||||
(( $+functions[_sqlx__database__help__setup_commands] )) ||
|
||||
_sqlx__database__help__setup_commands() {
|
||||
local commands; commands=()
|
||||
_describe -t commands 'sqlx database help setup commands' commands "$@"
|
||||
}
|
||||
(( $+functions[_sqlx__database__reset_commands] )) ||
|
||||
_sqlx__database__reset_commands() {
|
||||
local commands; commands=()
|
||||
_describe -t commands 'sqlx database reset commands' commands "$@"
|
||||
}
|
||||
(( $+functions[_sqlx__database__setup_commands] )) ||
|
||||
_sqlx__database__setup_commands() {
|
||||
local commands; commands=()
|
||||
_describe -t commands 'sqlx database setup commands' commands "$@"
|
||||
}
|
||||
(( $+functions[_sqlx__help_commands] )) ||
|
||||
_sqlx__help_commands() {
|
||||
local commands; commands=(
|
||||
'database:Group of commands for creating and dropping your database' \
|
||||
'prepare:Generate query metadata to support offline compile-time verification' \
|
||||
'migrate:Group of commands for creating and running migrations' \
|
||||
'completions:Generate shell completions for the specified shell' \
|
||||
'help:Print this message or the help of the given subcommand(s)' \
|
||||
)
|
||||
_describe -t commands 'sqlx help commands' commands "$@"
|
||||
}
|
||||
(( $+functions[_sqlx__help__completions_commands] )) ||
|
||||
_sqlx__help__completions_commands() {
|
||||
local commands; commands=()
|
||||
_describe -t commands 'sqlx help completions commands' commands "$@"
|
||||
}
|
||||
(( $+functions[_sqlx__help__database_commands] )) ||
|
||||
_sqlx__help__database_commands() {
|
||||
local commands; commands=(
|
||||
'create:Creates the database specified in your DATABASE_URL' \
|
||||
'drop:Drops the database specified in your DATABASE_URL' \
|
||||
'reset:Drops the database specified in your DATABASE_URL, re-creates it, and runs any pending migrations' \
|
||||
'setup:Creates the database specified in your DATABASE_URL and runs any pending migrations' \
|
||||
)
|
||||
_describe -t commands 'sqlx help database commands' commands "$@"
|
||||
}
|
||||
(( $+functions[_sqlx__help__database__create_commands] )) ||
|
||||
_sqlx__help__database__create_commands() {
|
||||
local commands; commands=()
|
||||
_describe -t commands 'sqlx help database create commands' commands "$@"
|
||||
}
|
||||
(( $+functions[_sqlx__help__database__drop_commands] )) ||
|
||||
_sqlx__help__database__drop_commands() {
|
||||
local commands; commands=()
|
||||
_describe -t commands 'sqlx help database drop commands' commands "$@"
|
||||
}
|
||||
(( $+functions[_sqlx__help__database__reset_commands] )) ||
|
||||
_sqlx__help__database__reset_commands() {
|
||||
local commands; commands=()
|
||||
_describe -t commands 'sqlx help database reset commands' commands "$@"
|
||||
}
|
||||
(( $+functions[_sqlx__help__database__setup_commands] )) ||
|
||||
_sqlx__help__database__setup_commands() {
|
||||
local commands; commands=()
|
||||
_describe -t commands 'sqlx help database setup commands' commands "$@"
|
||||
}
|
||||
(( $+functions[_sqlx__help__help_commands] )) ||
|
||||
_sqlx__help__help_commands() {
|
||||
local commands; commands=()
|
||||
_describe -t commands 'sqlx help help commands' commands "$@"
|
||||
}
|
||||
(( $+functions[_sqlx__help__migrate_commands] )) ||
|
||||
_sqlx__help__migrate_commands() {
|
||||
local commands; commands=(
|
||||
'add:Create a new migration with the given description' \
|
||||
'run:Run all pending migrations' \
|
||||
'revert:Revert the latest migration with a down file' \
|
||||
'info:List all available migrations' \
|
||||
'build-script:Generate a \`build.rs\` to trigger recompilation when a new migration is added' \
|
||||
)
|
||||
_describe -t commands 'sqlx help migrate commands' commands "$@"
|
||||
}
|
||||
(( $+functions[_sqlx__help__migrate__add_commands] )) ||
|
||||
_sqlx__help__migrate__add_commands() {
|
||||
local commands; commands=()
|
||||
_describe -t commands 'sqlx help migrate add commands' commands "$@"
|
||||
}
|
||||
(( $+functions[_sqlx__help__migrate__build-script_commands] )) ||
|
||||
_sqlx__help__migrate__build-script_commands() {
|
||||
local commands; commands=()
|
||||
_describe -t commands 'sqlx help migrate build-script commands' commands "$@"
|
||||
}
|
||||
(( $+functions[_sqlx__help__migrate__info_commands] )) ||
|
||||
_sqlx__help__migrate__info_commands() {
|
||||
local commands; commands=()
|
||||
_describe -t commands 'sqlx help migrate info commands' commands "$@"
|
||||
}
|
||||
(( $+functions[_sqlx__help__migrate__revert_commands] )) ||
|
||||
_sqlx__help__migrate__revert_commands() {
|
||||
local commands; commands=()
|
||||
_describe -t commands 'sqlx help migrate revert commands' commands "$@"
|
||||
}
|
||||
(( $+functions[_sqlx__help__migrate__run_commands] )) ||
|
||||
_sqlx__help__migrate__run_commands() {
|
||||
local commands; commands=()
|
||||
_describe -t commands 'sqlx help migrate run commands' commands "$@"
|
||||
}
|
||||
(( $+functions[_sqlx__help__prepare_commands] )) ||
|
||||
_sqlx__help__prepare_commands() {
|
||||
local commands; commands=()
|
||||
_describe -t commands 'sqlx help prepare commands' commands "$@"
|
||||
}
|
||||
(( $+functions[_sqlx__migrate_commands] )) ||
|
||||
_sqlx__migrate_commands() {
|
||||
local commands; commands=(
|
||||
'add:Create a new migration with the given description' \
|
||||
'run:Run all pending migrations' \
|
||||
'revert:Revert the latest migration with a down file' \
|
||||
'info:List all available migrations' \
|
||||
'build-script:Generate a \`build.rs\` to trigger recompilation when a new migration is added' \
|
||||
'help:Print this message or the help of the given subcommand(s)' \
|
||||
)
|
||||
_describe -t commands 'sqlx migrate commands' commands "$@"
|
||||
}
|
||||
(( $+functions[_sqlx__migrate__add_commands] )) ||
|
||||
_sqlx__migrate__add_commands() {
|
||||
local commands; commands=()
|
||||
_describe -t commands 'sqlx migrate add commands' commands "$@"
|
||||
}
|
||||
(( $+functions[_sqlx__migrate__build-script_commands] )) ||
|
||||
_sqlx__migrate__build-script_commands() {
|
||||
local commands; commands=()
|
||||
_describe -t commands 'sqlx migrate build-script commands' commands "$@"
|
||||
}
|
||||
(( $+functions[_sqlx__migrate__help_commands] )) ||
|
||||
_sqlx__migrate__help_commands() {
|
||||
local commands; commands=(
|
||||
'add:Create a new migration with the given description' \
|
||||
'run:Run all pending migrations' \
|
||||
'revert:Revert the latest migration with a down file' \
|
||||
'info:List all available migrations' \
|
||||
'build-script:Generate a \`build.rs\` to trigger recompilation when a new migration is added' \
|
||||
'help:Print this message or the help of the given subcommand(s)' \
|
||||
)
|
||||
_describe -t commands 'sqlx migrate help commands' commands "$@"
|
||||
}
|
||||
(( $+functions[_sqlx__migrate__help__add_commands] )) ||
|
||||
_sqlx__migrate__help__add_commands() {
|
||||
local commands; commands=()
|
||||
_describe -t commands 'sqlx migrate help add commands' commands "$@"
|
||||
}
|
||||
(( $+functions[_sqlx__migrate__help__build-script_commands] )) ||
|
||||
_sqlx__migrate__help__build-script_commands() {
|
||||
local commands; commands=()
|
||||
_describe -t commands 'sqlx migrate help build-script commands' commands "$@"
|
||||
}
|
||||
(( $+functions[_sqlx__migrate__help__help_commands] )) ||
|
||||
_sqlx__migrate__help__help_commands() {
|
||||
local commands; commands=()
|
||||
_describe -t commands 'sqlx migrate help help commands' commands "$@"
|
||||
}
|
||||
(( $+functions[_sqlx__migrate__help__info_commands] )) ||
|
||||
_sqlx__migrate__help__info_commands() {
|
||||
local commands; commands=()
|
||||
_describe -t commands 'sqlx migrate help info commands' commands "$@"
|
||||
}
|
||||
(( $+functions[_sqlx__migrate__help__revert_commands] )) ||
|
||||
_sqlx__migrate__help__revert_commands() {
|
||||
local commands; commands=()
|
||||
_describe -t commands 'sqlx migrate help revert commands' commands "$@"
|
||||
}
|
||||
(( $+functions[_sqlx__migrate__help__run_commands] )) ||
|
||||
_sqlx__migrate__help__run_commands() {
|
||||
local commands; commands=()
|
||||
_describe -t commands 'sqlx migrate help run commands' commands "$@"
|
||||
}
|
||||
(( $+functions[_sqlx__migrate__info_commands] )) ||
|
||||
_sqlx__migrate__info_commands() {
|
||||
local commands; commands=()
|
||||
_describe -t commands 'sqlx migrate info commands' commands "$@"
|
||||
}
|
||||
(( $+functions[_sqlx__migrate__revert_commands] )) ||
|
||||
_sqlx__migrate__revert_commands() {
|
||||
local commands; commands=()
|
||||
_describe -t commands 'sqlx migrate revert commands' commands "$@"
|
||||
}
|
||||
(( $+functions[_sqlx__migrate__run_commands] )) ||
|
||||
_sqlx__migrate__run_commands() {
|
||||
local commands; commands=()
|
||||
_describe -t commands 'sqlx migrate run commands' commands "$@"
|
||||
}
|
||||
(( $+functions[_sqlx__prepare_commands] )) ||
|
||||
_sqlx__prepare_commands() {
|
||||
local commands; commands=()
|
||||
_describe -t commands 'sqlx prepare commands' commands "$@"
|
||||
}
|
||||
|
||||
if [ "$funcstack[1]" = "_sqlx" ]; then
|
||||
_sqlx "$@"
|
||||
else
|
||||
compdef _sqlx sqlx
|
||||
fi
|
||||
74
config/zsh/completions/_trash
Normal file
74
config/zsh/completions/_trash
Normal file
@@ -0,0 +1,74 @@
|
||||
#compdef trash
|
||||
|
||||
# AUTOMATICALLY GENERATED by `shtab`
|
||||
|
||||
|
||||
_shtab_trash_commands() {
|
||||
local _commands=(
|
||||
|
||||
)
|
||||
_describe 'trash commands' _commands
|
||||
}
|
||||
|
||||
_shtab_trash_options=(
|
||||
"(- : *)"{-h,--help}"[show this help message and exit]"
|
||||
"(- : *)--print-completion[print shell completion script]:print_completion:(bash zsh tcsh)"
|
||||
{-d,--directory}"[ignored (for GNU rm compatibility)]"
|
||||
{-f,--force}"[silently ignore nonexistent files]"
|
||||
{-i,--interactive}"[prompt before every removal]"
|
||||
{-r,-R,--recursive}"[ignored (for GNU rm compatibility)]"
|
||||
"--trash-dir[use TRASHDIR as trash folder]:trashdir:(\${\$(trash-list --trash-dirs)#parent_*})"
|
||||
"*"{-v,--verbose}"[explain what is being done]"
|
||||
"(- : *)--version[show program\'s version number and exit]"
|
||||
"(*)::files:_trash_files"
|
||||
)
|
||||
|
||||
# guard to ensure default positional specs are added only once per session
|
||||
_shtab_trash_defaults_added=0
|
||||
|
||||
|
||||
_shtab_trash() {
|
||||
local context state line curcontext="$curcontext" one_or_more='(*)' remainder='(-)*' default='*::: :->trash'
|
||||
|
||||
# Add default positional/remainder specs only if none exist, and only once per session
|
||||
if (( ! _shtab_trash_defaults_added )); then
|
||||
if (( ${_shtab_trash_options[(I)${(q)one_or_more}*]} + ${_shtab_trash_options[(I)${(q)remainder}*]} + ${_shtab_trash_options[(I)${(q)default}]} == 0 )); then
|
||||
_shtab_trash_options+=(': :_shtab_trash_commands' '*::: :->trash')
|
||||
fi
|
||||
_shtab_trash_defaults_added=1
|
||||
fi
|
||||
_arguments -C -s $_shtab_trash_options
|
||||
|
||||
case $state in
|
||||
trash)
|
||||
words=($line[1] "${words[@]}")
|
||||
(( CURRENT += 1 ))
|
||||
curcontext="${curcontext%:*:*}:_shtab_trash-$line[1]:"
|
||||
case $line[1] in
|
||||
|
||||
esac
|
||||
esac
|
||||
}
|
||||
|
||||
# Custom Preamble
|
||||
|
||||
# https://github.com/zsh-users/zsh/blob/19390a1ba8dc983b0a1379058e90cd51ce156815/Completion/Unix/Command/_rm#L72-L74
|
||||
_trash_files() {
|
||||
(( CURRENT > 0 )) && line[CURRENT]=()
|
||||
line=( ${line//(#m)[\[\]()\\*?#<>~\^\|]/\\$MATCH} )
|
||||
_files -F line
|
||||
}
|
||||
|
||||
# End Custom Preamble
|
||||
|
||||
|
||||
typeset -A opt_args
|
||||
|
||||
if [[ $zsh_eval_context[-1] == eval ]]; then
|
||||
# eval/source/. command, register function for later
|
||||
compdef _shtab_trash -N trash
|
||||
else
|
||||
# autoload from fpath, call function directly
|
||||
_shtab_trash "$@"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user