diff --git a/CHANGELOG.md b/CHANGELOG.md index b2d8e3b9..a8e2207d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ This is a patch release with a few small bug fixes. Bug fixes: +* [BUG #2659](https://github.com/BurntSushi/ripgrep/issues/2659): + Fix Fish shell completions. * [BUG #2662](https://github.com/BurntSushi/ripgrep/issues/2662): Fix typo in documentation for `-i/--ignore-case`. diff --git a/crates/core/flags/complete/fish.rs b/crates/core/flags/complete/fish.rs index 6b28421f..e55d72e3 100644 --- a/crates/core/flags/complete/fish.rs +++ b/crates/core/flags/complete/fish.rs @@ -35,10 +35,11 @@ pub(crate) fn generate() -> String { .replace("!DOC!", &doc), ); if let Some(negated) = flag.name_negated() { + let long = format!("-l '{}'", negated.replace("'", "\\'")); out.push_str( - &template + &TEMPLATE .replace("!SHORT!", "") - .replace("!LONG!", &negated) + .replace("!LONG!", &long) .replace("!DOC!", &doc), ); }