From 1980630f1770da3d7d392dc3b743d04018217e34 Mon Sep 17 00:00:00 2001 From: Andrew Gallant Date: Wed, 13 May 2020 08:13:05 -0400 Subject: doc: fix egregious markup output We use '+++' syntax to output a literal '**' for a '--glob' example. This '+++' syntax is pretty ugly when rendered literally via --help. We fix this by hackily inserting the '+++' syntax for its one specific case that we need it during man page generation. Not ideal but it works. And --help still has some '*foo*' markup, but we live with that for now. Fixes #1581 --- CHANGELOG.md | 10 ++++++++++ build.rs | 4 ++++ crates/core/app.rs | 2 +- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6924da41..88169fb4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ +TBD +=== +Unreleased changes. Release notes have not yet been written. + +Bug fixes: + +* [BUG #1581](https://github.com/BurntSushi/ripgrep/issues/1581): + Corrects some egregious markup output in `--help`. + + 12.1.0 (2020-05-09) =================== ripgrep 12.1.0 is a small minor version release that mostly includes bug fixes diff --git a/build.rs b/build.rs index 6fa7c1ac..b4b62b9c 100644 --- a/build.rs +++ b/build.rs @@ -217,6 +217,10 @@ fn formatted_doc_txt(arg: &RGArg) -> io::Result { .doc_long .replace("{", "{") .replace("}", r"}") + // Hack to render ** literally in man page correctly. We can't put + // these crazy +++ in the help text directly, since that shows + // literally in --help output. + .replace("*-g 'foo/**'*", "*-g +++'foo/**'+++*") .split("\n\n") .map(|s| s.to_string()) .collect(); diff --git a/crates/core/app.rs b/crates/core/app.rs index 69f9b57c..9535844a 100644 --- a/crates/core/app.rs +++ b/crates/core/app.rs @@ -1354,7 +1354,7 @@ command line takes precedence. When this flag is set, every file and directory is applied to it to test for a match. So for example, if you only want to search in a particular directory 'foo', then *-g foo* is incorrect because 'foo/bar' does not match the glob -'foo'. Instead, you should use *-g +++'foo/**'+++*. +'foo'. Instead, you should use *-g 'foo/**'*. " ); let arg = RGArg::flag("glob", "GLOB") -- cgit v1.2.3