Fix another instance of the 'bat cache' bug, closes #584
commit2e7114680173acd906e53ef5c3dd6e7b77014113
authorsharkdp <davidpeter@web.de>
dateSat 31 Aug 2019, 14:13 (7 years ago)
parentf3824ba
src/clap_app.rs+1
@@ -19,6 +19,7 @@ pub fn build_app(interactive_output: bool) -> ClapApp<'static, 'static> {
1919 .global_setting(AppSettings::UnifiedHelpMessage)
2020 .global_setting(AppSettings::HidePossibleValuesInHelp)
2121 .setting(AppSettings::ArgsNegateSubcommands)
22+ .setting(AppSettings::AllowExternalSubcommands)
2223 .setting(AppSettings::DisableHelpSubcommand)
2324 .setting(AppSettings::VersionlessSubcommands)
2425 .max_term_width(100)
tests/examples/cache.cnew file+1
tests/integration_tests.rs+11−1
@@ -451,7 +451,7 @@ fn utf16() {
451451
452452#[test]
453453fn can_print_file_named_cache() {
454− bat()
454+ bat_with_config()
455455 .arg("cache")
456456 .assert()
457457 .success()
@@ -459,6 +459,16 @@ fn can_print_file_named_cache() {
459459 .stderr("");
460460}
461461
462+#[test]
463+fn can_print_file_starting_with_cache() {
464+ bat_with_config()
465+ .arg("cache.c")
466+ .assert()
467+ .success()
468+ .stdout("test\n")
469+ .stderr("");
470+}
471+
462472#[test]
463473fn does_not_print_unwanted_file_named_cache() {
464474 bat_with_config().arg("cach").assert().failure();