on master help sign in
Add --no-config option
495e7fdsharkdp
src/app.rs+3−1
@@ -98,7 +98,9 @@ impl App {
98 }
98 }
99
99
100 fn matches(interactive_output: bool) -> ArgMatches<'static> {
100 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+ {
102 // Skip the arguments in bats config file
104 // Skip the arguments in bats config file
103
105
104 wild::args_os().collect::<Vec<_>>()
106 wild::args_os().collect::<Vec<_>>()
src/clap_app.rs+6
@@ -243,6 +243,12 @@ pub fn build_app(interactive_output: bool) -> ClapApp<'static, 'static> {
243 .hidden(true)
243 .hidden(true)
244 .help("Set the width of the terminal"),
244 .help("Set the width of the terminal"),
245 )
245 )
246+ .arg(
247+ Arg::with_name("no-config")
248+ .long("no-config")
249+ .hidden(true)
250+ .help("Do not use the configuration file"),
251+ )
246 .subcommand(
252 .subcommand(
247 SubCommand::with_name("cache")
253 SubCommand::with_name("cache")
248 .about("Modify the syntax-definition and theme cache")
254 .about("Modify the syntax-definition and theme cache")
tests/integration_tests.rs+1
@@ -6,6 +6,7 @@ use std::process::Command;
6fn bat() -> Command {
6fn bat() -> Command {
7 let mut cmd = Command::main_binary().unwrap();
7 let mut cmd = Command::main_binary().unwrap();
8 cmd.current_dir("tests/examples");
8 cmd.current_dir("tests/examples");
9+ cmd.arg("--no-config");
9 cmd
10 cmd
10}
11}
11
12
tests/tester.rs+1
@@ -43,6 +43,7 @@ impl BatTester {
43 .current_dir(self.temp_dir.path())
43 .current_dir(self.temp_dir.path())
44 .args(&[
44 .args(&[
45 "sample.rs",
45 "sample.rs",
46+ "--no-config",
46 "--paging=never",
47 "--paging=never",
47 "--color=never",
48 "--color=never",
48 "--decorations=always",
49 "--decorations=always",