From 32546d6491927e2d351a7f144288721f01f154a7 Mon Sep 17 00:00:00 2001 From: Mahmoud Al-Qudsi Date: Tue, 10 Sep 2019 03:17:06 -0500 Subject: [PATCH] Reorder `rustup` completions to avoid undefined function error [ci skip] --- share/completions/rustup.fish | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/share/completions/rustup.fish b/share/completions/rustup.fish index ff0a5f2a3..de8c9ed18 100644 --- a/share/completions/rustup.fish +++ b/share/completions/rustup.fish @@ -35,15 +35,6 @@ set __rustup_components \ # __rustup_strip_common_suffix_strict $not_installed # end -# Trim trailing attributes, e.g. "rust-whatever (default)" -> "rust-whatever" -set -l __rustup_toolchains (rustup toolchain list | string replace -rf "\s+.*" '') -# By default, the long name of a toolchain is used (e.g. nightly-x86_64-unknown-linux-gnu), -# but a shorter version can be used if it is unambiguous. -set -l __rustup_toolchains_short (__rustup_strip_common_suffix_strict $__rustup_toolchains) - -# Needs to be global to retain access from functions -set __rustup_channels "beta" "stable" "nightly" - # All *valid* target triples, retrieved from source function __rustup_triples # The list below must be kept sorted alphabetically @@ -228,6 +219,15 @@ function __rustup_installed_components __rustup_common_suffix_strict $installed end +# Trim trailing attributes, e.g. "rust-whatever (default)" -> "rust-whatever" +set -l __rustup_toolchains (rustup toolchain list | string replace -rf "\s+.*" '') +# By default, the long name of a toolchain is used (e.g. nightly-x86_64-unknown-linux-gnu), +# but a shorter version can be used if it is unambiguous. +set -l __rustup_toolchains_short (__rustup_strip_common_suffix_strict $__rustup_toolchains) + +# Needs to be global to retain access from functions +set __rustup_channels "beta" "stable" "nightly" + complete -c rustup -n "__fish_should_complete_switches" -s v -l verbose complete -c rustup -n "__fish_should_complete_switches" -s h -l help complete -c rustup -n "__fish_should_complete_switches" -s V -l version