on master help sign in
Add --no-config option
commit495e7fd3b1766c889f048a88c9702310f6d7c1a6 authorsharkdp <davidpeter@web.de> dateThu 11 Oct 2018, 21:40 (8 years ago) parentb48f0fe
4 files changed+11−1
src/app.rs+3−1 src/clap_app.rs+6 tests/integration_tests.rs+1 tests/tester.rs+1
src/app.rs+3−1
@@ -98,7 +98,9 @@ impl App {
9898 }
9999
100100 fn matches(interactive_output: bool) -> ArgMatches<'static> {
101− let args = if wild::args_os().nth(1) == Some("cache".into()) {
101+ let args = if wild::args_os().nth(1) == Some("cache".into())
102+ || wild::args_os().any(|arg| arg == "--no-config")
103+ {
102104 // Skip the arguments in bats config file
103105
104106 wild::args_os().collect::<Vec<_>>()
src/clap_app.rs+6
@@ -243,6 +243,12 @@ pub fn build_app(interactive_output: bool) -> ClapApp<'static, 'static> {
243243 .hidden(true)
244244 .help("Set the width of the terminal"),
245245 )
246+ .arg(
247+ Arg::with_name("no-config")
248+ .long("no-config")
249+ .hidden(true)
250+ .help("Do not use the configuration file"),
251+ )
246252 .subcommand(
247253 SubCommand::with_name("cache")
248254 .about("Modify the syntax-definition and theme cache")
tests/integration_tests.rs+1
@@ -6,6 +6,7 @@ use std::process::Command;
66fn bat() -> Command {
77 let mut cmd = Command::main_binary().unwrap();
88 cmd.current_dir("tests/examples");
9+ cmd.arg("--no-config");
910 cmd
1011}
1112
tests/tester.rs+1
@@ -43,6 +43,7 @@ impl BatTester {
4343 .current_dir(self.temp_dir.path())
4444 .args(&[
4545 "sample.rs",
46+ "--no-config",
4647 "--paging=never",
4748 "--color=never",
4849 "--decorations=always",