From 6ae0d39e5a81515891570a4bce94c9f91f7275f7 Mon Sep 17 00:00:00 2001 From: cflmy Date: Thu, 22 Oct 2026 15:34:55 +0800 Subject: [PATCH] =?UTF-8?q?feat(labels):=20=E5=85=BC=E5=AE=B9=E6=96=87?= =?UTF-8?q?=E6=A1=A3=E9=87=8C=E7=9A=84=20labels=20pending=20/=20labels=20s?= =?UTF-8?q?earch=20=E5=86=99=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 设计文档写的是 `labels pending` / `labels search --grep`,CLI 是扁平参数。 把 pending/search 作为无意义位置词过滤掉,使两种写法都可用(不动参数语义)。 实测:labels pending --count → 2;labels search --grep 联调 --count → 1。 全量 605 passed / 0 failed。 --- src/main.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main.rs b/src/main.rs index 3fcc9a6..030a26b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -628,6 +628,15 @@ fn try_main(cli: Cli) -> Result { } } + // Accept the documented shapes `labels pending` / `labels search` + // as no-op words (the flags carry the real intent). + let paths: Vec<&std::path::PathBuf> = paths + .iter() + .filter(|p| { + let s = p.to_string_lossy(); + !(s == "pending" || s == "search") + }) + .collect(); let mut files: Vec = Vec::new(); for p in &paths { files.extend(collect_mq_files(p)?);