From 4868166f86e2f6c7c54082c36c9c7a5d67dc1092 Mon Sep 17 00:00:00 2001 From: Mahmoud Al-Qudsi Date: Sun, 26 May 2024 21:44:02 -0500 Subject: [PATCH] completions/rustc: preserve trailing = in -Z values --- share/completions/rustc.fish | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/share/completions/rustc.fish b/share/completions/rustc.fish index 0a35c7216..e0141e86b 100644 --- a/share/completions/rustc.fish +++ b/share/completions/rustc.fish @@ -35,7 +35,7 @@ function __fish_rustc_z_completions end 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 docs @@ -59,9 +59,9 @@ function __fish_rustc_z_completions # echo \* $line if set -l parts (string match -gr '^(?:or )?`=?(.*?)`\s*(?:\((.*?)\)|: (.*))?\s*' -- $line) 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) - 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 end