From dc5fe0ea968bf84fa49cbf07f0ebab035bc7c5f2 Mon Sep 17 00:00:00 2001 From: wenzhuozhen Date: Wed, 24 Jun 2026 21:33:25 +0800 Subject: [PATCH] fix(sheets): align history flag-defs with inline shortcuts (green TestFlagsFor) TestFlagsFor_EveryRegisteredCommandHasDefs was RED: generated flag-defs drifted from the hand-written history shortcuts. - +history-revert-status: flag-defs had --history-version-id; the BE-2 fix switched the shortcut to --transaction-id. Updated the entry to transaction-id. - +history-revert / -status --history-version-id were marked required="required", but the inline flags are cobra-optional (requiredness enforced in Validate). Set required="optional" to match. Regenerated flag_defs_gen.go. NOTE: canonical source is sheet-skill-spec (BE-3); apply the same change upstream or the next sync:cli will regress this. --- shortcuts/sheets/data/flag-defs.json | 8 ++++---- shortcuts/sheets/flag_defs_gen.go | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/shortcuts/sheets/data/flag-defs.json b/shortcuts/sheets/data/flag-defs.json index 8772c1fc..aac626f1 100644 --- a/shortcuts/sheets/data/flag-defs.json +++ b/shortcuts/sheets/data/flag-defs.json @@ -4872,7 +4872,7 @@ "name": "history-version-id", "kind": "own", "type": "string", - "required": "required", + "required": "optional", "desc": "History version to revert to (from +history-list)." }, { @@ -4902,11 +4902,11 @@ "desc": "Spreadsheet locator" }, { - "name": "history-version-id", + "name": "transaction-id", "kind": "own", "type": "string", - "required": "required", - "desc": "History version whose revert status to query (from +history-list)." + "required": "optional", + "desc": "Async revert transaction id (from +history-revert)." }, { "name": "dry-run", diff --git a/shortcuts/sheets/flag_defs_gen.go b/shortcuts/sheets/flag_defs_gen.go index 21e2b020..6790d356 100644 --- a/shortcuts/sheets/flag_defs_gen.go +++ b/shortcuts/sheets/flag_defs_gen.go @@ -659,7 +659,7 @@ var flagDefs = map[string]commandDef{ Flags: []flagDef{ {Name: "url", Kind: "public", Type: "string", Required: "xor", Desc: "Spreadsheet locator"}, {Name: "spreadsheet-token", Kind: "public", Type: "string", Required: "xor", Desc: "Spreadsheet locator"}, - {Name: "history-version-id", Kind: "own", Type: "string", Required: "required", Desc: "History version to revert to (from +history-list)."}, + {Name: "history-version-id", Kind: "own", Type: "string", Required: "optional", Desc: "History version to revert to (from +history-list)."}, {Name: "dry-run", Kind: "system", Type: "bool", Required: "optional"}, }, }, @@ -668,7 +668,7 @@ var flagDefs = map[string]commandDef{ Flags: []flagDef{ {Name: "url", Kind: "public", Type: "string", Required: "xor", Desc: "Spreadsheet locator"}, {Name: "spreadsheet-token", Kind: "public", Type: "string", Required: "xor", Desc: "Spreadsheet locator"}, - {Name: "history-version-id", Kind: "own", Type: "string", Required: "required", Desc: "History version whose revert status to query (from +history-list)."}, + {Name: "transaction-id", Kind: "own", Type: "string", Required: "optional", Desc: "Async revert transaction id (from +history-revert)."}, {Name: "dry-run", Kind: "system", Type: "bool", Required: "optional"}, }, },