Skip to content
Myr

core: bleat a DEBUG message when RIPGREP_CONFIG_PATH is not set

Before adoption: this commit came in with the history the project adopted, so no landing records it.

It seems to be common that folks either don't understand how to set environment variables in a way that propagates to subprocesses, or just forget to include `export` and think ripgrep is somehow broken. While `RIPGREP_CONFIG_PATH` not being set is not an error, it still seems useful to log a debug message when it isn't. This should hopefully provide a clue that, no, ripgrep isn't broken. It just doesn't see the environment variable. Ref #3277

authored by Andrew Gallant · committed by Andrew Gallant · parent 9b84e15 · Browse files · 1 file+7 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+7 added−1 removed

  • other:+7 added−1 removed

1 file+7 added−1 removed

modified:crates/core/flags/config.rs+7 added-1 removed
13 unmodified lines
1415/// Return a sequence of arguments derived from ripgrep rc configuration files.16pub fn args() -> Vec<OsString> {17 let config_path = match std::env::var_os("RIPGREP_CONFIG_PATH") {18 None => return vec![],18 None => {19 log::debug!(20 "RIPGREP_CONFIG_PATH environment variable is not set, \21 therefore not reading any config file"22 );23 return vec![];24 }25 Some(config_path) => {26 if config_path.is_empty() {27 return vec![];28 }
148 unmodified lines