From ba9eacb701e9de2eec2a0693e09fec7691a404d3 Mon Sep 17 00:00:00 2001 From: Thayne McCombs Date: Tue, 18 Jul 2023 00:16:01 -0600 Subject: [PATCH] Fix documentation for brace escapes --- doc/fd.1 | 10 ++++++---- src/cli.rs | 3 ++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/doc/fd.1 b/doc/fd.1 index ec5b44daf..0f8960557 100644 --- a/doc/fd.1 +++ b/doc/fd.1 @@ -376,14 +376,16 @@ parent directory path without file extension .IP {/.} basename without file extension -.IP {{} -literal '{' +.IP {{ +literal '{' (an escape sequence) +.IP }} +literal '}' (an escape sequence) .RE If no placeholder is present, an implicit "{}" at the end is assumed. -If you need to include the literal text of one of the placeholders, you can use "{{}" to -escape the first "{". For example "{{}}" expands to "{}", and "{{}{{}}}" expands to "{{}". +Notice that you can use "{{" and "}}" to escape "{" and "}" respectively, which is especially +useful if you need to include the literal text of one of the above placeholders. Examples: diff --git a/src/cli.rs b/src/cli.rs index 8b1e9022d..4695a8e07 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -800,7 +800,8 @@ impl clap::Args for Exec { '{//}': parent directory\n \ '{.}': path without file extension\n \ '{/.}': basename without file extension\n \ - '{{}': literal '{' (for escaping)\n\n\ + '{{': literal '{' (for escaping)\n \ + '}}': literal '}' (for escaping)\n\n\ If no placeholder is present, an implicit \"{}\" at the end is assumed.\n\n\ Examples:\n\n \ - find all *.zip files and unzip them:\n\n \