From 83069f14b1091097fb486ea2987632787bc9ac23 Mon Sep 17 00:00:00 2001 From: Lennard Hofmann Date: Sun, 10 May 2026 18:41:33 +0200 Subject: [PATCH] Document how to escape $ in --help output --- gen/completions/_sd | 2 +- gen/sd.1 | 2 +- sd-cli/src/cli.rs | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/gen/completions/_sd b/gen/completions/_sd index 3cdab05..67fdbe2 100644 --- a/gen/completions/_sd +++ b/gen/completions/_sd @@ -30,7 +30,7 @@ _sd() { '-V[Print version]' \ '--version[Print version]' \ ':find -- The regexp or string (if using `-F`) to search for:' \ -':replace_with -- What to replace each match with. Unless in string mode, you may use captured values like $1, $2, etc:' \ +':replace_with -- What to replace each match with. Unless in string mode, you may use captured values like $1, $2, etc. Use $$ to get a literal dollar sign:' \ '*::files -- The path to file(s). This is optional - sd can also read from STDIN:_files' \ && ret=0 } diff --git a/gen/sd.1 b/gen/sd.1 index 9a41984..c43cb50 100644 --- a/gen/sd.1 +++ b/gen/sd.1 @@ -53,7 +53,7 @@ Print version The regexp or string (if using `\-F`) to search for .TP <\fIREPLACE_WITH\fR> -What to replace each match with. Unless in string mode, you may use captured values like $1, $2, etc +What to replace each match with. Unless in string mode, you may use captured values like $1, $2, etc. Use $$ to get a literal dollar sign .TP [\fIFILES\fR] The path to file(s). This is optional \- sd can also read from STDIN. diff --git a/sd-cli/src/cli.rs b/sd-cli/src/cli.rs index 73de8fe..eb205cd 100644 --- a/sd-cli/src/cli.rs +++ b/sd-cli/src/cli.rs @@ -67,7 +67,8 @@ w - match full words only pub find: String, /// What to replace each match with. Unless in string mode, you may - /// use captured values like $1, $2, etc. + /// use captured values like $1, $2, etc. Use $$ to get a literal + /// dollar sign. pub replace_with: String, /// The path to file(s). This is optional - sd can also read from STDIN.