diff --git a/shortcuts/sheets/lark_sheet_changeset.go b/shortcuts/sheets/lark_sheet_changeset.go index 455e2fb82..275533094 100644 --- a/shortcuts/sheets/lark_sheet_changeset.go +++ b/shortcuts/sheets/lark_sheet_changeset.go @@ -75,14 +75,14 @@ func changesetRevisions(runtime flagView) (start int, end int, err error) { start = runtime.Int("start-revision") end = runtime.Int("end-revision") if start < 1 { - return 0, 0, common.FlagErrorf("--start-revision must be >= 1") + return 0, 0, sheetsValidationForFlag("start-revision", "--start-revision must be >= 1") } if end > 0 { if end < start { - return 0, 0, common.FlagErrorf("--end-revision (%d) must be >= --start-revision (%d)", end, start) + return 0, 0, sheetsValidationForFlag("end-revision", "--end-revision (%d) must be >= --start-revision (%d)", end, start) } if end-start+1 > changesetMaxRevGap { - return 0, 0, common.FlagErrorf("version gap exceeds limit %d (start=%d, end=%d)", changesetMaxRevGap, start, end) + return 0, 0, sheetsValidationForFlag("end-revision", "version gap exceeds limit %d (start=%d, end=%d)", changesetMaxRevGap, start, end) } } return start, end, nil diff --git a/shortcuts/sheets/lark_sheet_history_revert.go b/shortcuts/sheets/lark_sheet_history_revert.go index 249b3e8c4..3ece11621 100644 --- a/shortcuts/sheets/lark_sheet_history_revert.go +++ b/shortcuts/sheets/lark_sheet_history_revert.go @@ -73,7 +73,8 @@ func historyRevertInput(token, versionID string) map[string]interface{} { // history version id — the facade-agg status tool keys on transaction_id). // Required at the cli surface (cobra MarkFlagRequired) — same gating model as // historyVersionIDFlag. Validate still trims + rejects empty/control-char -// values to catch the "--transaction-id ''" cobra-accepts-but-empty case. +// values to catch the case where cobra accepts --transaction-id with an +// empty-string value. func transactionIDFlag() common.Flag { return common.Flag{ Name: "transaction-id", @@ -110,7 +111,7 @@ func historyRevertStatusInput(token, transactionID string) map[string]interface{ // Validate runs with cobra's standard "required flag(s)" error (which the // dispatcher classifies as a typed *errs.ValidationError, exit 2). We still // trim + reject empty / control-char values in Validate to catch the -// "--history-version-id ''" cobra-accepts-but-empty case. +// case where cobra accepts --history-version-id with an empty-string value. var HistoryRevert = common.Shortcut{ Service: "sheets", Command: "+history-revert",