Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions tools/hygiene/audit-agencysignature-main-tip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,10 @@ interface ArgParseResult {
readonly errorMessage: string;
}

type StringArgKey = "commitSha" | "maxN" | "sinceDate" | "branch" | "v1ShipDate";

type ArgStep =
| { readonly kind: "ok"; readonly key: keyof MutableArgs; readonly value: string; readonly setMode: Mode | null; readonly skip: 1 }
| { readonly kind: "ok"; readonly key: StringArgKey; readonly value: string; readonly setMode: Mode | null; readonly skip: 1 }
| { readonly kind: "error"; readonly message: string }
Comment thread
AceHack marked this conversation as resolved.
Outdated
| { readonly kind: "help" };

Expand All @@ -91,7 +93,7 @@ interface MutableArgs {
}

function classifyArg(arg: string, next: string | undefined): ArgStep {
const requiresNext: Record<string, { key: keyof MutableArgs; setMode: Mode | null; missing: string }> = {
const requiresNext: Record<string, { key: StringArgKey; setMode: Mode | null; missing: string }> = {
"--commit": { key: "commitSha", setMode: "commit", missing: "error: --commit requires SHA" },
"--max": { key: "maxN", setMode: "max", missing: "error: --max requires N" },
"--since": { key: "sinceDate", setMode: "since", missing: "error: --since requires DATE (YYYY-MM-DD)" },
Expand Down
Loading