diff --git a/src/cli.rs b/src/cli.rs index 761a25b..81d789f 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -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 diff --git a/tests/lib.rs b/tests/lib.rs index 5b0ec5b..c6df992 100644 --- a/tests/lib.rs +++ b/tests/lib.rs @@ -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() {