From 27e88adcd55ee0e0654883c4bf9a1f1dc0ca68b5 Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Sat, 7 Mar 2020 19:54:50 +0100 Subject: [PATCH] Re-fix cargo completions Using a local variable means we have to expand it when loading the completion. With this approach, the content of the variable will be expanded, so escape it. --- share/completions/cargo.fish | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/share/completions/cargo.fish b/share/completions/cargo.fish index d4c964b1d..e07fc0846 100644 --- a/share/completions/cargo.fish +++ b/share/completions/cargo.fish @@ -5,10 +5,10 @@ complete -c cargo -l list -d 'List installed commands' complete -c cargo -s v -l verbose -d 'Use verbose output' complete -c cargo -s q -l quiet -d 'No output printed to stdout' -set -lx __fish_cargo_subcommands (cargo --list 2>&1 | string replace -rf '^\s+([^\s]+)\s+(.*)' '$1\t$2') +set -lx __fish_cargo_subcommands (cargo --list 2>&1 | string replace -rf '^\s+([^\s]+)\s+(.*)' '$1\t$2' | string escape) -complete -c cargo -f -c cargo -n '__fish_use_subcommand' -a '$__fish_cargo_subcommands' -complete -c cargo -x -c cargo -n '__fish_seen_subcommand_from help' -a '$__fish_cargo_subcommands' +complete -c cargo -f -c cargo -n '__fish_use_subcommand' -a "$__fish_cargo_subcommands" +complete -c cargo -x -c cargo -n '__fish_seen_subcommand_from help' -a "$__fish_cargo_subcommands" for x in bench build clean doc fetch generate-lockfile \ locate-project package pkgid publish \