mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-30 11:21:15 -03:00
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:
@@ -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 \
|
||||
|
||||
Reference in New Issue
Block a user