Best headless browser for AI agents. Lite, Fast, High-Compatibility. Built in Rust
Rust ai-agentsai-toolsbrowserbrowser-automationcloud-browserheadlessheadless-browserkitesurfplaywrightpuppeteerrustservoweb-crawlerweb-crawlingweb-scraperweb-scraping
fix(cli): reject conflicting user agent flags
ldm0b73a10d810ae
diff --git a/moli/src/cli.rs b/moli/src/cli.rsindex 1d08febeb..0421bd5f1 100644--- a/moli/src/cli.rs+++ b/moli/src/cli.rs@@ -465,10 +465,10 @@ pub struct CommonArgs {#[arg(long, num_args = 0..=1, default_missing_value = "")]pub log_filter_scopes: Option<String>,- #[arg(short = 'A', long)]+ #[arg(short = 'A', long, conflicts_with = "user_agent_suffix")]pub user_agent: Option<String>,- #[arg(long)]+ #[arg(long, conflicts_with = "user_agent")]pub user_agent_suffix: Option<String>,/// Unencrypted PKCS#8 Ed25519 private key used for Web Bot Auth signatures.diff --git a/moli/tests/cli.rs b/moli/tests/cli.rsindex 4da5206ef..4bf581919 100644--- a/moli/tests/cli.rs+++ b/moli/tests/cli.rs@@ -637,8 +637,6 @@ fn app_config_uses_moli_user_agent_defaults() {"fetch","--user-agent","ExampleBrowser/1.0",- "--user-agent-suffix",- "ignored","https://example.com",])).unwrap();@@ -646,6 +644,21 @@ fn app_config_uses_moli_user_agent_defaults() {assert_eq!(config.browser.fetch().user_agent(), "ExampleBrowser/1.0");}+#[test]+fn user_agent_and_suffix_conflict() {+ let error = Cli::try_parse_from(normalize_args_for_compat([+ "moli",+ "fetch",+ "-A",+ "ExampleBrowser/1.0",+ "--user-agent-suffix",+ "internal-tester",+ "https://example.com",+ ]))+ .unwrap_err();+ assert_eq!(error.kind(), clap::error::ErrorKind::ArgumentConflict);+}+#[test]fn app_config_makes_fetch_quiet_unless_log_level_is_set() {let quiet_cli = Cli::try_parse_from(normalize_args_for_compat([