Allow --no-auto-update without a command (#501)

This commit is contained in:
VXNCXNX 2026-08-16 23:25:20 +02:00 committed by GitHub
commit 21ab081dae
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 14 additions and 1 deletions

View file

@ -69,7 +69,7 @@ pub(crate) struct Cli {
pub update: bool,
/// If auto update is configured, disable it for this run
#[arg(long = "no-auto-update", requires = "command_or_file")]
#[arg(long = "no-auto-update")]
pub no_auto_update: bool,
/// Clear the local cache

View file

@ -1313,6 +1313,19 @@ fn test_autoupdate_cache() {
check_cache_updated(false);
}
/// Regression test: `--no-auto-update` should be usable together with `--list`,
/// since the auto-update gate in `main.rs` also applies to `--list`.
#[test]
fn test_no_auto_update_with_list() {
let testenv = TestEnv::new().install_default_cache();
testenv
.command()
.args(["--list", "--no-auto-update"])
.assert()
.success();
}
/// End-end test to ensure .page.md files overwrite pages in cache_dir
#[test]
fn test_custom_page_overwrites() {