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.
This commit is contained in:
Johannes Altmanninger 2020-03-07 19:54:50 +01:00
parent db62953e0f
commit 27e88adcd5

View file

@ -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 \