summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Gallant <jamslam@gmail.com>2020-11-15 15:00:08 -0500
committerAndrew Gallant <jamslam@gmail.com>2020-11-15 15:00:08 -0500
commitf32e90601291f18559c376d2e51e214b58f7980b (patch)
tree12f1d61bb6ba5eb3ca13a2308c4c5f492f343948
parent59644d45928fff5ae2ef509a2ed6a5b63a7baf8c (diff)
doc: clarify that CLI invocation must always be valid
This comes up as a corner case where folks provide -e/--regexp in a configuration file and then expect to be able to run 'rg' with no args. However, ripgrep fails because it still expects at least one pattern even though one was specified in the config file. This occurs because ripgrep has to parse its CLI parameters before reading the config file. (For log output settings and to handle the --no-config flag.) This initial parse will fail if there are no patterns specified. The only way to solve this that I can see is to somehow relax the requirements of the initial parse. But this is problematic because we would still need to enforce those requirements in cases where we don't do a second parse (when no config file is present). All in all, this doesn't seem like a problem that is worth solving. Closes #1730
-rw-r--r--doc/rg.1.txt.tpl10
1 files changed, 6 insertions, 4 deletions
diff --git a/doc/rg.1.txt.tpl b/doc/rg.1.txt.tpl
index c0d1bad7..aef86746 100644
--- a/doc/rg.1.txt.tpl
+++ b/doc/rg.1.txt.tpl
@@ -191,10 +191,12 @@ simple. It is defined by two rules:
whitespace) are ignored.
ripgrep will look for a single configuration file if and only if the
-*RIPGREP_CONFIG_PATH* environment variable is set and is non-empty.
-ripgrep will parse shell arguments from this file on startup and will
-behave as if the arguments in this file were prepended to any explicit
-arguments given to ripgrep on the command line.
+*RIPGREP_CONFIG_PATH* environment variable is set and is non-empty. ripgrep
+will parse shell arguments from this file on startup and will behave as if
+the arguments in this file were prepended to any explicit arguments given to
+ripgrep on the command line. Note though that the 'rg' command you run must
+still be valid. That is, it must always contain at least one pattern at the
+command line, even if the configuration file uses the '-e/--regexp' flag.
For example, if your ripgreprc file contained a single line: