@@ -57,34 +57,35 @@ var cardListCmd = &cobra.Command{
5757 params = append (params , "board_ids[]=" + boardID )
5858 }
5959
60- clientSideColumnFilter := ""
61- clientSideTriage := false
6260 if columnFilter != "" {
6361 if pseudo , ok := parsePseudoColumnID (columnFilter ); ok {
6462 switch pseudo .Kind {
6563 case "not_now" :
6664 if effectiveIndexedBy != "" && effectiveIndexedBy != "not_now" {
67- return errors .NewInvalidArgsError ("cannot combine --indexed-by with --column maybe" )
65+ return errors .NewInvalidArgsError ("cannot combine --indexed-by with --column " + columnFilter )
6866 }
6967 effectiveIndexedBy = "not_now"
7068 case "closed" :
7169 if effectiveIndexedBy != "" && effectiveIndexedBy != "closed" {
72- return errors .NewInvalidArgsError ("cannot combine --indexed-by with --column done" )
70+ return errors .NewInvalidArgsError ("cannot combine --indexed-by with --column " + columnFilter )
7371 }
7472 effectiveIndexedBy = "closed"
7573 case "triage" :
76- if effectiveIndexedBy != "" {
77- return errors .NewInvalidArgsError ("cannot combine --indexed-by with --column not-yet" )
74+ if effectiveIndexedBy != "" && effectiveIndexedBy != "maybe" {
75+ return errors .NewInvalidArgsError ("cannot combine --indexed-by with --column " + columnFilter )
7876 }
79- clientSideTriage = true
77+ effectiveIndexedBy = "maybe"
8078 default :
81- clientSideColumnFilter = columnFilter
79+ if effectiveIndexedBy != "" {
80+ return errors .NewInvalidArgsError ("cannot combine --indexed-by with --column" )
81+ }
82+ params = append (params , "column_ids[]=" + columnFilter )
8283 }
8384 } else {
8485 if effectiveIndexedBy != "" {
8586 return errors .NewInvalidArgsError ("cannot combine --indexed-by with --column" )
8687 }
87- clientSideColumnFilter = columnFilter
88+ params = append ( params , "column_ids[]=" + columnFilter )
8889 }
8990 }
9091
@@ -128,10 +129,6 @@ var cardListCmd = &cobra.Command{
128129 path += "?" + strings .Join (params , "&" )
129130 }
130131
131- if (clientSideTriage || clientSideColumnFilter != "" ) && ! cardListAll && cardListPage == 0 {
132- return errors .NewInvalidArgsError ("Filtering by column requires --all (or --page) because it is applied client-side" )
133- }
134-
135132 var items any
136133 var linkNext string
137134
@@ -150,46 +147,6 @@ var cardListCmd = &cobra.Command{
150147 linkNext = parseSDKLinkNext (resp )
151148 }
152149
153- if clientSideTriage || clientSideColumnFilter != "" {
154- arr := toSliceAny (items )
155- if arr == nil {
156- return errors .NewError ("Unexpected cards list response" )
157- }
158-
159- filtered := make ([]any , 0 , len (arr ))
160- for _ , item := range arr {
161- card , ok := item .(map [string ]any )
162- if ! ok {
163- continue
164- }
165-
166- columnID := ""
167- if v , ok := card ["column_id" ].(string ); ok {
168- columnID = v
169- }
170- if columnID == "" {
171- if col , ok := card ["column" ].(map [string ]any ); ok {
172- if id , ok := col ["id" ].(string ); ok {
173- columnID = id
174- }
175- }
176- }
177-
178- if clientSideTriage {
179- if columnID == "" {
180- filtered = append (filtered , item )
181- }
182- continue
183- }
184-
185- if clientSideColumnFilter != "" && columnID == clientSideColumnFilter {
186- filtered = append (filtered , item )
187- }
188- }
189-
190- items = filtered
191- }
192-
193150 // Build summary
194151 count := dataCount (items )
195152 summary := fmt .Sprintf ("%d cards" , count )
@@ -1082,9 +1039,9 @@ func init() {
10821039
10831040 // List
10841041 cardListCmd .Flags ().StringVar (& cardListBoard , "board" , "" , "Filter by board ID" )
1085- cardListCmd .Flags ().StringVar (& cardListColumn , "column" , "" , "Filter by column ID or pseudo column (not-yet , maybe, done)" )
1042+ cardListCmd .Flags ().StringVar (& cardListColumn , "column" , "" , "Filter by column ID or pseudo column (not-now , maybe, done)" )
10861043 cardListCmd .Flags ().StringVar (& cardListTag , "tag" , "" , "Filter by tag ID" )
1087- cardListCmd .Flags ().StringVar (& cardListIndexedBy , "indexed-by" , "" , "Filter by lane/index (all, closed, not_now, stalled, postponing_soon, golden)" )
1044+ cardListCmd .Flags ().StringVar (& cardListIndexedBy , "indexed-by" , "" , "Filter by lane/index (all, closed, maybe, not_now, stalled, postponing_soon, golden)" )
10881045 cardListCmd .Flags ().StringVar (& cardListIndexedBy , "status" , "" , "Alias for --indexed-by" )
10891046 _ = cardListCmd .Flags ().MarkDeprecated ("status" , "use --indexed-by" )
10901047 cardListCmd .Flags ().StringVar (& cardListAssignee , "assignee" , "" , "Filter by assignee ID" )
0 commit comments