1
0
mirror of https://github.com/sharkdp/bat synced 2026-06-09 10:03:18 +00:00

fix(cache): allow --help flag for cache subcommand (#3580)

* fix(cache): allow --help flag for cache subcommand

* docs: add changelog entry for cache --help fix
This commit is contained in:
dddffgg
2026-02-09 11:06:40 +08:00
committed by GitHub
parent 391e7ff072
commit cb8b637574
3 changed files with 29 additions and 8 deletions
+17
View File
@@ -3684,3 +3684,20 @@ fn quiet_empty_suppresses_output_on_empty_file() {
.success()
.stdout("");
}
#[test]
fn cache_help_shows_help_message() {
// Test that `bat cache --help` works (fixes #3560)
// Run in cache_source directory which doesn't have a file named "cache"
bat_with_config()
.current_dir(Path::new(EXAMPLES_DIR).join("cache_source"))
.arg("cache")
.arg("--help")
.assert()
.success()
.stdout(predicate::str::contains(
"Modify the syntax-definition and theme cache",
))
.stdout(predicate::str::contains("--build"))
.stdout(predicate::str::contains("--clear"));
}