mirror of
https://github.com/fish-shell/fish-shell
synced 2024-11-10 15:14:44 +00:00
completions/rustc: preserve trailing = in -Z values
This commit is contained in:
parent
84d057e7b7
commit
4868166f86
1 changed files with 3 additions and 3 deletions
|
@ -35,7 +35,7 @@ function __fish_rustc_z_completions
|
||||||
end
|
end
|
||||||
|
|
||||||
set -l rust_docs (rustc +nightly -Z help 2>/dev/null |
|
set -l rust_docs (rustc +nightly -Z help 2>/dev/null |
|
||||||
string replace -r '^\s+' '' | string replace -ar ' +' ' ' | string replace -r '=val +-- +' '\t')
|
string replace -r '^\s+' '' | string replace -ar ' +' ' ' | string replace -r '=val +-- +' '=\t')
|
||||||
|
|
||||||
set -f flag
|
set -f flag
|
||||||
set -f docs
|
set -f docs
|
||||||
|
@ -59,9 +59,9 @@ function __fish_rustc_z_completions
|
||||||
# echo \* $line
|
# echo \* $line
|
||||||
if set -l parts (string match -gr '^(?:or )?`=?(.*?)`\s*(?:\((.*?)\)|: (.*))?\s*' -- $line)
|
if set -l parts (string match -gr '^(?:or )?`=?(.*?)`\s*(?:\((.*?)\)|: (.*))?\s*' -- $line)
|
||||||
set -l docs $parts[2] $parts[3]
|
set -l docs $parts[2] $parts[3]
|
||||||
printf '%s=%s\t%s\n' $flag $parts[1] $docs
|
printf '%s%s\t%s\n' $flag $parts[1] $docs
|
||||||
else if set -l parts (string match -gr '^([a-z-]+):?\s*(.*)' -- $line)
|
else if set -l parts (string match -gr '^([a-z-]+):?\s*(.*)' -- $line)
|
||||||
printf '%s=%s\t%s\n' $flag $parts[1] $parts[2]
|
printf '%s%s\t%s\n' $flag $parts[1] $parts[2]
|
||||||
end | string match -ev '=val'
|
end | string match -ev '=val'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue