1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
|
Description: Do not customize shell completions
Due to lack of stability guarantees on generated scripts, customizing shell
completions requires pinning the version of clap-complete, which is not
compatible with how distributions work.
Author: NoisyCoil <noisycoil@debian.org>
Bug: https://github.com/casey/just/issues/2882
Forwarded: not-needed
Last-Update: 2025-09-26
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/src/completions.rs
+++ b/src/completions.rs
@@ -25,7 +25,7 @@
}
fn clap(shell: clap_complete::Shell) -> RunResult<'static, String> {
- fn replace(haystack: &mut String, needle: &str, replacement: &str) -> RunResult<'static, ()> {
+ /* fn replace(haystack: &mut String, needle: &str, replacement: &str) -> RunResult<'static, ()> {
if let Some(index) = haystack.find(needle) {
haystack.replace_range(index..index + needle.len(), replacement);
Ok(())
@@ -34,7 +34,7 @@
"Failed to find text:\n{needle}\n…in completion script:\n{haystack}"
)))
}
- }
+ } */
let mut script = {
let mut tempfile = tempfile().map_err(|io_error| Error::TempfileIo { io_error })?;
@@ -59,7 +59,7 @@
buffer
};
- match shell {
+ /* match shell {
clap_complete::Shell::Bash => {
for (needle, replacement) in completions::BASH_COMPLETION_REPLACEMENTS {
replace(&mut script, needle, replacement)?;
@@ -79,7 +79,7 @@
}
}
_ => {}
- }
+ } */
Ok(script.trim().into())
}
--- a/tests/lib.rs
+++ b/tests/lib.rs
@@ -55,7 +55,7 @@
mod changelog;
mod choose;
mod command;
-mod completions;
+//mod completions;
mod conditional;
mod confirm;
mod constants;
|