Skip to content

Commit

Permalink
Fix documentation for brace escapes
Browse files Browse the repository at this point in the history
  • Loading branch information
tmccombs committed Aug 9, 2023
1 parent 9ece7ba commit 231aea2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
10 changes: 6 additions & 4 deletions doc/fd.1
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
3 changes: 2 additions & 1 deletion src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down

0 comments on commit 231aea2

Please sign in to comment.