fix: CLI --mode text 报错'未知模式' — 补充 text 匹配分支

This commit is contained in:
2026-06-20 17:32:23 +08:00
parent 9a204d0312
commit 5fb967a353
+4
View File
@@ -313,6 +313,10 @@ fn build_text_from_args(args: &Args) -> anyhow::Result<String> {
.url .url
.clone() .clone()
.ok_or_else(|| anyhow::anyhow!("URL 模式需要 --url")), .ok_or_else(|| anyhow::anyhow!("URL 模式需要 --url")),
Some("text") => args
.content
.clone()
.ok_or_else(|| anyhow::anyhow!("文本模式需要提供编码内容")),
Some(m) => anyhow::bail!("未知模式: {m}。支持 text/url/wifi/vcard/email/phone/sms/batch"), Some(m) => anyhow::bail!("未知模式: {m}。支持 text/url/wifi/vcard/email/phone/sms/batch"),
None => args None => args
.content .content