mirror of
https://github.com/tealdeer-rs/tealdeer.git
synced 2026-08-21 07:34:18 +02:00
Allow --no-auto-update without a command (#501)
This commit is contained in:
parent
64db5accfa
commit
21ab081dae
2 changed files with 14 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
13
tests/lib.rs
13
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() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue