From 21ab081daee909cdf2df491c571efa1cc50247c2 Mon Sep 17 00:00:00 2001 From: VXNCXNX <93332837+VXNCXNX@users.noreply.github.com> Date: Sun, 16 Aug 2026 23:25:20 +0200 Subject: [PATCH] Allow --no-auto-update without a command (#501) --- src/cli.rs | 2 +- tests/lib.rs | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) 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() {