Skip to content

feat: support comma-separated values in --state flag#189

Draft
jholm117 wants to merge 1 commit intoschpet:mainfrom
jholm117:worktree-agent-af7b5ad5
Draft

feat: support comma-separated values in --state flag#189
jholm117 wants to merge 1 commit intoschpet:mainfrom
jholm117:worktree-agent-af7b5ad5

Conversation

@jholm117
Copy link
Contributor

Summary

  • Allow --state triage,started as a shorthand for --state triage --state started
  • Comma-separated values are split, trimmed, and validated against valid states (triage, backlog, unstarted, started, completed, canceled)
  • Invalid values produce a clear ValidationError with the list of valid states

Motivation

Passing --state triage,started is the intuitive way to specify multiple states in a single flag, but previously only the repeated flag form (--state triage --state started) worked. This change supports both forms.

Changes

  • src/commands/issue/issue-list.ts — Changed --state flag type from state (EnumType) to string so comma-separated values pass through Cliffy parsing. Added flatMap + split(",") to parse comma-separated values, with manual validation against validStates.
  • test/commands/issue/issue-list.test.ts — Added snapshot tests for invalid comma-separated state and invalid single state validation errors.
  • test/commands/issue/__snapshots__/issue-list.test.ts.snap — Updated help text snapshot (new description) and added error output snapshots.

Test plan

  • deno test --allow-all --quiet test/commands/issue/issue-list.test.ts — 3/3 pass
  • deno check src/commands/issue/issue-list.ts — clean
  • deno lint src/commands/issue/issue-list.ts — clean
  • Manual test: linear issue list --state triage,started --sort priority
  • Manual test: linear issue list --state triage --state started --sort priority (existing behavior preserved)

🤖 Generated with Claude Code

Allow `--state triage,started` as a shorthand for `--state triage --state started`.
Values are split on commas, trimmed, and validated against the set of valid states
(triage, backlog, unstarted, started, completed, canceled). Invalid values produce
a clear ValidationError.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant