diff --git a/Cargo.lock b/Cargo.lock index 2790b471..267e0755 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,3 +1,5 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. [[package]] name = "adler32" version = "1.0.3" diff --git a/src/clap_app.rs b/src/clap_app.rs index adce2b1d..16c36d25 100644 --- a/src/clap_app.rs +++ b/src/clap_app.rs @@ -18,7 +18,6 @@ pub fn build_app(interactive_output: bool) -> ClapApp<'static, 'static> { .global_setting(AppSettings::DeriveDisplayOrder) .global_setting(AppSettings::UnifiedHelpMessage) .global_setting(AppSettings::HidePossibleValuesInHelp) - .setting(AppSettings::InferSubcommands) .setting(AppSettings::ArgsNegateSubcommands) .setting(AppSettings::DisableHelpSubcommand) .setting(AppSettings::VersionlessSubcommands) diff --git a/tests/examples/cache b/tests/examples/cache new file mode 100644 index 00000000..9daeafb9 --- /dev/null +++ b/tests/examples/cache @@ -0,0 +1 @@ +test diff --git a/tests/integration_tests.rs b/tests/integration_tests.rs index 7d9856ac..ec1ffd3f 100644 --- a/tests/integration_tests.rs +++ b/tests/integration_tests.rs @@ -448,3 +448,18 @@ fn utf16() { .success() .stdout(std::str::from_utf8(b"\xEF\xBB\xBFhello world\n").unwrap()); } + +#[test] +fn can_print_file_named_cache() { + bat() + .arg("cache") + .assert() + .success() + .stdout("test\n") + .stderr(""); +} + +#[test] +fn does_not_print_unwanted_file_named_cache() { + bat_with_config().arg("cach").assert().failure(); +}