From cba33e4630325c479d14cee57adf4d3d65a5042c Mon Sep 17 00:00:00 2001 From: David Li Date: Wed, 13 May 2026 18:12:08 +0800 Subject: [PATCH] fix(cli): require '=' for --tcp flag to prevent subcommand collision --tcp consumed the following subcommand as its value (e.g. 'wx --tcp daemon start' parsed --tcp=daemon). Adding require_equals=true forces --tcp=ADDR syntax so subcommands are parsed correctly. --- src/cli/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cli/mod.rs b/src/cli/mod.rs index 1815f22..f4e1ba7 100644 --- a/src/cli/mod.rs +++ b/src/cli/mod.rs @@ -24,7 +24,7 @@ use clap::{Parser, Subcommand}; #[command(name = "wx", version = env!("CARGO_PKG_VERSION"), about = "wx — 微信本地数据 CLI")] pub struct Cli { /// 通过 TCP 连接 daemon(如 127.0.0.1:9876) - #[arg(long)] + #[arg(long, require_equals = true)] pub tcp: Option, #[command(subcommand)]