@@ -58,6 +58,7 @@ func listAction(_ context.Context, cmd *cli.Command) error {
5858
5959 openOnly := cmd .Bool ("open" )
6060 readyOnly := cmd .Bool ("ready" )
61+ limit := cmd .Int ("limit" )
6162
6263 // Sort issues by timestamps (only what we'll display)
6364 sortByCreatedAt (readyIssues )
@@ -68,11 +69,33 @@ func listAction(_ context.Context, cmd *cli.Command) error {
6869 sortByUpdatedAt (closedIssues )
6970 }
7071
72+ // Track original counts before applying limit
73+ readyTotalCount := len (readyIssues )
74+ blockedTotalCount := len (blockedIssues )
75+ closedTotalCount := len (closedIssues )
76+
77+ // Apply limit to each section (if limit > 0)
78+ if limit > 0 {
79+ if len (readyIssues ) > limit {
80+ readyIssues = readyIssues [:limit ]
81+ }
82+ if len (blockedIssues ) > limit {
83+ blockedIssues = blockedIssues [:limit ]
84+ }
85+ if len (closedIssues ) > limit {
86+ closedIssues = closedIssues [:limit ]
87+ }
88+ }
89+
7190 // Display READY section
7291 if _ , err := fmt .Fprintln (w ); err != nil {
7392 return err
7493 }
7594 readyHeader := "\033 [48;5;2m\033 [38;5;0m READY \033 [0m"
95+ // Add limit indicator if section is actually limited
96+ if limit > 0 && len (readyIssues ) < readyTotalCount {
97+ readyHeader += fmt .Sprintf (" \033 [38;5;8m(%d of %d)\033 [0m" , len (readyIssues ), readyTotalCount )
98+ }
7699 if _ , err := fmt .Fprintln (w , readyHeader ); err != nil {
77100 return err
78101 }
@@ -97,6 +120,10 @@ func listAction(_ context.Context, cmd *cli.Command) error {
97120 }
98121
99122 blockedHeader := "\033 [48;5;1m\033 [38;5;0m BLOCKED \033 [0m"
123+ // Add limit indicator if section is actually limited
124+ if limit > 0 && len (blockedIssues ) < blockedTotalCount {
125+ blockedHeader += fmt .Sprintf (" \033 [38;5;8m(%d of %d)\033 [0m" , len (blockedIssues ), blockedTotalCount )
126+ }
100127 if _ , err := fmt .Fprintln (w , blockedHeader ); err != nil {
101128 return err
102129 }
@@ -122,6 +149,10 @@ func listAction(_ context.Context, cmd *cli.Command) error {
122149 }
123150
124151 closedHeader := "\033 [48;5;0m\033 [38;5;15m CLOSED \033 [0m"
152+ // Add limit indicator if section is actually limited
153+ if limit > 0 && len (closedIssues ) < closedTotalCount {
154+ closedHeader += fmt .Sprintf (" \033 [38;5;8m(%d of %d)\033 [0m" , len (closedIssues ), closedTotalCount )
155+ }
125156 if _ , err := fmt .Fprintln (w , closedHeader ); err != nil {
126157 return err
127158 }
0 commit comments