@@ -25,18 +25,16 @@ export const listCommand = new Command()
2525 . type ( "sort" , SortType )
2626 . type ( "state" , StateType )
2727 . option (
28- "--sort <sort:sort >" ,
29- "Sort order (can also be set via LINEAR_ISSUE_SORT )" ,
28+ "-s, --state <state:state >" ,
29+ "Filter by issue state (can be repeated for multiple states )" ,
3030 {
31- required : false ,
31+ default : [ "unstarted" ] ,
32+ collect : true ,
3233 } ,
3334 )
3435 . option (
35- "-s, --state <state:state>" ,
36- "Filter by issue state" ,
37- {
38- default : "unstarted" ,
39- } ,
36+ "--all-states" ,
37+ "Show issues from all states" ,
4038 )
4139 . option (
4240 "--assignee <assignee:string>" ,
@@ -50,11 +48,27 @@ export const listCommand = new Command()
5048 "-U, --unassigned" ,
5149 "Show only unassigned issues" ,
5250 )
51+ . option (
52+ "--sort <sort:sort>" ,
53+ "Sort order (can also be set via LINEAR_ISSUE_SORT)" ,
54+ {
55+ required : false ,
56+ } ,
57+ )
5358 . option ( "-w, --web" , "Open in web browser" )
5459 . option ( "-a, --app" , "Open in Linear.app" )
5560 . action (
5661 async (
57- { sort : sortFlag , state, assignee, allAssignees, unassigned, web, app } ,
62+ {
63+ sort : sortFlag ,
64+ state,
65+ assignee,
66+ allAssignees,
67+ unassigned,
68+ web,
69+ app,
70+ allStates,
71+ } ,
5872 ) => {
5973 if ( web || app ) {
6074 console . error (
@@ -67,15 +81,23 @@ export const listCommand = new Command()
6781 }
6882
6983 // Validate that conflicting flags are not used together
70- const flagCount =
84+ const assigneeFilterCount =
7185 [ assignee , allAssignees , unassigned ] . filter ( Boolean ) . length ;
72- if ( flagCount > 1 ) {
86+ if ( assigneeFilterCount > 1 ) {
7387 console . error (
7488 "Cannot specify multiple assignee filters (--assignee, --all-assignees, --unassigned)" ,
7589 ) ;
7690 Deno . exit ( 1 ) ;
7791 }
7892
93+ // Validate state filters are not used together
94+ if ( allStates && ( state . length > 1 || state [ 0 ] !== "unstarted" ) ) {
95+ console . error (
96+ "Cannot use --all-states with --state flag" ,
97+ ) ;
98+ Deno . exit ( 1 ) ;
99+ }
100+
79101 const sort = sortFlag ||
80102 getOption ( "issue_sort" ) as "manual" | "priority" | undefined ;
81103 if ( ! sort ) {
@@ -102,7 +124,7 @@ export const listCommand = new Command()
102124 try {
103125 const result = await fetchIssuesForState (
104126 teamId ,
105- state ,
127+ allStates ? undefined : state ,
106128 assignee ,
107129 unassigned ,
108130 allAssignees ,
0 commit comments