diff --git a/src/clap_app.rs b/src/clap_app.rs index 1884dbea..08d6b632 100644 --- a/src/clap_app.rs +++ b/src/clap_app.rs @@ -19,6 +19,7 @@ pub fn build_app(interactive_output: bool) -> ClapApp<'static, 'static> { .global_setting(AppSettings::UnifiedHelpMessage) .global_setting(AppSettings::HidePossibleValuesInHelp) .setting(AppSettings::ArgsNegateSubcommands) + .setting(AppSettings::AllowExternalSubcommands) .setting(AppSettings::DisableHelpSubcommand) .setting(AppSettings::VersionlessSubcommands) .max_term_width(100) diff --git a/tests/examples/cache.c b/tests/examples/cache.c new file mode 100644 index 00000000..9daeafb9 --- /dev/null +++ b/tests/examples/cache.c @@ -0,0 +1 @@ +test diff --git a/tests/integration_tests.rs b/tests/integration_tests.rs index 6a1e0839..120449a7 100644 --- a/tests/integration_tests.rs +++ b/tests/integration_tests.rs @@ -451,7 +451,7 @@ fn utf16() { #[test] fn can_print_file_named_cache() { - bat() + bat_with_config() .arg("cache") .assert() .success() @@ -459,6 +459,16 @@ fn can_print_file_named_cache() { .stderr(""); } +#[test] +fn can_print_file_starting_with_cache() { + bat_with_config() + .arg("cache.c") + .assert() + .success() + .stdout("test\n") + .stderr(""); +} + #[test] fn does_not_print_unwanted_file_named_cache() { bat_with_config().arg("cach").assert().failure();