summaryrefslogtreecommitdiffstats
path: root/vendor/clap_complete/src/shells
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
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')
-rw-r--r--vendor/clap_complete/src/shells/bash.rs2
-rw-r--r--vendor/clap_complete/src/shells/fish.rs6
-rw-r--r--vendor/clap_complete/src/shells/powershell.rs4
3 files changed, 8 insertions, 4 deletions
diff --git a/vendor/clap_complete/src/shells/bash.rs b/vendor/clap_complete/src/shells/bash.rs
index 60e6b346c..2a97e1de2 100644
--- a/vendor/clap_complete/src/shells/bash.rs
+++ b/vendor/clap_complete/src/shells/bash.rs
@@ -58,7 +58,7 @@ impl Generator for Bash {
esac
}}
-complete -F _{name} -o bashdefault -o default {name}
+complete -F _{name} -o nosort -o bashdefault -o default {name}
",
name = bin_name,
cmd = bin_name.replace('-', "__"),
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<_>>()
diff --git a/vendor/clap_complete/src/shells/powershell.rs b/vendor/clap_complete/src/shells/powershell.rs
index 417facf70..6b09b2e3a 100644
--- a/vendor/clap_complete/src/shells/powershell.rs
+++ b/vendor/clap_complete/src/shells/powershell.rs
@@ -124,7 +124,9 @@ fn generate_aliases(completions: &mut String, preamble: &String, arg: &Arg) {
for alias in aliases {
let _ = write!(
completions,
- "{preamble}'-{alias}', '{alias}', [CompletionResultType]::ParameterName, '{tooltip}')"
+ "{preamble}'-{alias}', '{alias}{}', [CompletionResultType]::ParameterName, '{tooltip}')",
+ // make PowerShell realize there is a difference between `-s` and `-S`
+ if alias.is_uppercase() { " " } else { "" },
);
}
}