1
0
mirror of https://github.com/DazAh/dotfiles synced 2026-05-21 18:25:46 +01:00

update cs config and rust auto-completions

This commit is contained in:
DazAh
2020-05-27 16:38:30 +01:00
parent 6c0814b4f6
commit 6664bd899a
47 changed files with 949 additions and 14 deletions
+102 -7
View File
@@ -17,19 +17,22 @@ _rustup() {
_arguments "${_arguments_options[@]}" \
'-v[Enable verbose output]' \
'--verbose[Enable verbose output]' \
'(-v --verbose)-q[Disable progress output]' \
'(-v --verbose)--quiet[Disable progress output]' \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
'::+toolchain -- release channel (e.g. +stable) or custom toolchain to set override:_files' \
":: :_rustup_commands" \
"*::: :->rustup" \
&& ret=0
case $state in
(rustup)
words=($line[1] "${words[@]}")
words=($line[2] "${words[@]}")
(( CURRENT += 1 ))
curcontext="${curcontext%:*:*}:rustup-command-$line[1]:"
case $line[1] in
curcontext="${curcontext%:*:*}:rustup-command-$line[2]:"
case $line[2] in
(dump-testament)
_arguments "${_arguments_options[@]}" \
'-h[Prints help information]' \
@@ -69,6 +72,22 @@ _arguments "${_arguments_options[@]}" \
'--version[Prints version information]' \
&& ret=0
;;
(profile)
_arguments "${_arguments_options[@]}" \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
&& ret=0
;;
(keys)
_arguments "${_arguments_options[@]}" \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" \
'-h[Prints help information]' \
@@ -83,6 +102,7 @@ esac
;;
(install)
_arguments "${_arguments_options[@]}" \
'--profile=[]: :(minimal default complete)' \
'--no-self-update[Don'\''t perform self-update when running the `rustup install` command]' \
'--force[Force an update, even if some components are missing]' \
'-h[Prints help information]' \
@@ -112,6 +132,14 @@ _arguments "${_arguments_options[@]}" \
'::toolchain -- Toolchain name, such as 'stable', 'nightly', or '1.8.0'. For more information see `rustup help toolchain`:_files' \
&& ret=0
;;
(check)
_arguments "${_arguments_options[@]}" \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
&& ret=0
;;
(default)
_arguments "${_arguments_options[@]}" \
'-h[Prints help information]' \
@@ -138,6 +166,8 @@ case $state in
case $line[1] in
(list)
_arguments "${_arguments_options[@]}" \
'-v[Enable verbose output with toolchain information]' \
'--verbose[Enable verbose output with toolchain information]' \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
@@ -146,7 +176,14 @@ _arguments "${_arguments_options[@]}" \
;;
(update)
_arguments "${_arguments_options[@]}" \
'--no-self-update[Don'\''t perform self update when running the `rustup toolchain install` command]' \
'--profile=[]: :(minimal default complete)' \
'*-c+[Add specific components on installation]' \
'*--component=[Add specific components on installation]' \
'*-t+[Add specific targets on installation]' \
'*--target=[Add specific targets on installation]' \
'--no-self-update[Don'\''t perform self update when running the`rustup toolchain install` command]' \
'--force[Force an update, even if some components are missing]' \
'--allow-downgrade[Allow rustup to downgrade the toolchain to satisfy your component choice]' \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
@@ -156,7 +193,14 @@ _arguments "${_arguments_options[@]}" \
;;
(add)
_arguments "${_arguments_options[@]}" \
'--no-self-update[Don'\''t perform self update when running the `rustup toolchain install` command]' \
'--profile=[]: :(minimal default complete)' \
'*-c+[Add specific components on installation]' \
'*--component=[Add specific components on installation]' \
'*-t+[Add specific targets on installation]' \
'*--target=[Add specific targets on installation]' \
'--no-self-update[Don'\''t perform self update when running the`rustup toolchain install` command]' \
'--force[Force an update, even if some components are missing]' \
'--allow-downgrade[Allow rustup to downgrade the toolchain to satisfy your component choice]' \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
@@ -166,7 +210,14 @@ _arguments "${_arguments_options[@]}" \
;;
(install)
_arguments "${_arguments_options[@]}" \
'--no-self-update[Don'\''t perform self update when running the `rustup toolchain install` command]' \
'--profile=[]: :(minimal default complete)' \
'*-c+[Add specific components on installation]' \
'*--component=[Add specific components on installation]' \
'*-t+[Add specific targets on installation]' \
'*--target=[Add specific targets on installation]' \
'--no-self-update[Don'\''t perform self update when running the`rustup toolchain install` command]' \
'--force[Force an update, even if some components are missing]' \
'--allow-downgrade[Allow rustup to downgrade the toolchain to satisfy your component choice]' \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
@@ -438,6 +489,7 @@ _arguments "${_arguments_options[@]}" \
;;
(which)
_arguments "${_arguments_options[@]}" \
'--toolchain=[Toolchain name, such as '\''stable'\'', '\''nightly'\'', or '\''1.8.0'\''. For more information see `rustup help toolchain`]' \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
@@ -468,6 +520,7 @@ _arguments "${_arguments_options[@]}" \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
'::topic -- Topic such as 'core', 'fn', 'usize', 'eprintln!', 'core::arch', 'alloc::format!', 'std::fs', 'std::fs::read_dir', 'std::io::Bytes', 'std::iter::Sum', 'std::io::error::Result' etc...:_files' \
&& ret=0
;;
(doc)
@@ -493,6 +546,7 @@ _arguments "${_arguments_options[@]}" \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
'::topic -- Topic such as 'core', 'fn', 'usize', 'eprintln!', 'core::arch', 'alloc::format!', 'std::fs', 'std::fs::read_dir', 'std::io::Bytes', 'std::iter::Sum', 'std::io::error::Result' etc...:_files' \
&& ret=0
;;
(man)
@@ -581,6 +635,15 @@ _arguments "${_arguments_options[@]}" \
':host_triple:_files' \
&& ret=0
;;
(profile)
_arguments "${_arguments_options[@]}" \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
':profile-name:(minimal default complete)' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" \
'-h[Prints help information]' \
@@ -620,10 +683,11 @@ esac
_rustup_commands() {
local commands; commands=(
"dump-testament:Dump information about the build" \
"show:Show the active and installed toolchains" \
"show:Show the active and installed toolchains or profiles" \
"install:Update Rust toolchains" \
"uninstall:Uninstall Rust toolchains" \
"update:Update Rust toolchains and rustup" \
"check:Check for updates to Rust toolchains" \
"default:Set the default toolchain" \
"toolchain:Modify or query the installed toolchains" \
"target:Modify a toolchain's supported targets" \
@@ -682,6 +746,13 @@ _rustup__toolchain__add_commands() {
)
_describe -t commands 'rustup toolchain add commands' commands "$@"
}
(( $+functions[_rustup__check_commands] )) ||
_rustup__check_commands() {
local commands; commands=(
)
_describe -t commands 'rustup check commands' commands "$@"
}
(( $+functions[_rustup__completions_commands] )) ||
_rustup__completions_commands() {
local commands; commands=(
@@ -825,6 +896,13 @@ _rustup__toolchain__install_commands() {
)
_describe -t commands 'rustup toolchain install commands' commands "$@"
}
(( $+functions[_rustup__show__keys_commands] )) ||
_rustup__show__keys_commands() {
local commands; commands=(
)
_describe -t commands 'rustup show keys commands' commands "$@"
}
(( $+functions[_rustup__toolchain__link_commands] )) ||
_rustup__toolchain__link_commands() {
local commands; commands=(
@@ -877,6 +955,20 @@ _rustup__override_commands() {
)
_describe -t commands 'rustup override commands' commands "$@"
}
(( $+functions[_rustup__set__profile_commands] )) ||
_rustup__set__profile_commands() {
local commands; commands=(
)
_describe -t commands 'rustup set profile commands' commands "$@"
}
(( $+functions[_rustup__show__profile_commands] )) ||
_rustup__show__profile_commands() {
local commands; commands=(
)
_describe -t commands 'rustup show profile commands' commands "$@"
}
(( $+functions[_rustup__component__remove_commands] )) ||
_rustup__component__remove_commands() {
local commands; commands=(
@@ -940,6 +1032,7 @@ _rustup__override__set_commands() {
_rustup__set_commands() {
local commands; commands=(
"default-host:The triple used to identify toolchains when not specified" \
"profile:The default components installed" \
"help:Prints this message or the help of the given subcommand(s)" \
)
_describe -t commands 'rustup set commands' commands "$@"
@@ -949,6 +1042,8 @@ _rustup__show_commands() {
local commands; commands=(
"active-toolchain:Show the active toolchain" \
"home:Display the computed value of RUSTUP_HOME" \
"profile:Show the current profile" \
"keys:Display the known PGP keys" \
"help:Prints this message or the help of the given subcommand(s)" \
)
_describe -t commands 'rustup show commands' commands "$@"