summaryrefslogtreecommitdiffstats
path: root/vendor/clap_complete/src/shells/fish.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-07 05:48:48 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-07 05:48:48 +0000
commitef24de24a82fe681581cc130f342363c47c0969a (patch)
tree0d494f7e1a38b95c92426f58fe6eaa877303a86c /vendor/clap_complete/src/shells/fish.rs
parentReleasing progress-linux version 1.74.1+dfsg1-1~progress7.99u1. (diff)
downloadrustc-ef24de24a82fe681581cc130f342363c47c0969a.tar.xz
rustc-ef24de24a82fe681581cc130f342363c47c0969a.zip
Merging upstream version 1.75.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/clap_complete/src/shells/fish.rs')
-rw-r--r--vendor/clap_complete/src/shells/fish.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/vendor/clap_complete/src/shells/fish.rs b/vendor/clap_complete/src/shells/fish.rs
index 5a069d35b..7dae5b6d6 100644
--- a/vendor/clap_complete/src/shells/fish.rs
+++ b/vendor/clap_complete/src/shells/fish.rs
@@ -168,10 +168,12 @@ fn value_completion(option: &Arg) -> String {
.filter_map(|value| if value.is_hide_set() {
None
} else {
+ // The help text after \t is wrapped in '' to make sure that the it is taken literally
+ // and there is no command substitution or variable expansion resulting in unexpected errors
Some(format!(
- "{}\t{}",
+ "{}\t'{}'",
escape_string(value.get_name(), true).as_str(),
- escape_string(&value.get_help().unwrap_or_default().to_string(), true)
+ escape_string(&value.get_help().unwrap_or_default().to_string(), false)
))
})
.collect::<Vec<_>>()