@@ -629,6 +629,21 @@ pub fn parser(pre_flight_settings: PreFlightSettings) -> Command {
629629 . subcommands ( command_groups)
630630}
631631
632+ fn pagination_args ( ) -> [ Arg ; 2 ] {
633+ [
634+ Arg :: new ( "page" )
635+ . long ( "page" )
636+ . help ( "page number (1-indexed)" )
637+ . required ( false )
638+ . value_parser ( value_parser ! ( u64 ) . range ( 1 ..) ) ,
639+ Arg :: new ( "page_size" )
640+ . long ( "page-size" )
641+ . help ( "number of results per page (default: 100, max: 500)" )
642+ . required ( false )
643+ . value_parser ( value_parser ! ( u64 ) . range ( 1 ..=500 ) ) ,
644+ ]
645+ }
646+
632647fn list_subcommands ( pre_flight_settings : PreFlightSettings ) -> Vec < Command > {
633648 let nodes_cmd = Command :: new ( "nodes" ) . long_about ( "Lists cluster members" ) ;
634649 let vhosts_cmd = Command :: new ( "vhosts" )
@@ -648,7 +663,8 @@ fn list_subcommands(pre_flight_settings: PreFlightSettings) -> Vec<Command> {
648663 . after_help ( color_print:: cformat!(
649664 "<bold>Doc guide</bold>: {}" ,
650665 CONNECTION_GUIDE_URL
651- ) ) ;
666+ ) )
667+ . args ( pagination_args ( ) ) ;
652668 let channels_cmd = Command :: new ( "channels" )
653669 . long_about ( "Lists AMQP 0-9-1 channels" )
654670 . after_help ( color_print:: cformat!(
@@ -660,7 +676,8 @@ fn list_subcommands(pre_flight_settings: PreFlightSettings) -> Vec<Command> {
660676 . after_help ( color_print:: cformat!(
661677 "<bold>Doc guide</bold>: {}" ,
662678 QUEUE_GUIDE_URL
663- ) ) ;
679+ ) )
680+ . args ( pagination_args ( ) ) ;
664681 let exchanges_cmd = Command :: new ( "exchanges" ) . long_about ( "Lists exchanges" ) ;
665682 let bindings_cmd = Command :: new ( "bindings" ) . long_about ( "Lists bindings" ) ;
666683 let consumers_cmd = Command :: new ( "consumers" )
@@ -1578,7 +1595,8 @@ fn queues_subcommands(pre_flight_settings: PreFlightSettings) -> Vec<Command> {
15781595 . after_help ( color_print:: cformat!(
15791596 "<bold>Doc guide</bold>: {}" ,
15801597 QUEUE_GUIDE_URL
1581- ) ) ;
1598+ ) )
1599+ . args ( pagination_args ( ) ) ;
15821600 let purge_cmd = Command :: new ( "purge" )
15831601 . long_about ( "Purges (permanently removes unacknowledged messages from) a queue" )
15841602 . arg (
@@ -1647,11 +1665,12 @@ fn streams_subcommands(pre_flight_settings: PreFlightSettings) -> Vec<Command> {
16471665 )
16481666 . arg ( idempotently_arg. clone ( ) ) ;
16491667 let list_cmd = Command :: new ( "list" )
1650- . long_about ( "Lists streams and queues and " )
1668+ . long_about ( "Lists streams and queues" )
16511669 . after_help ( color_print:: cformat!(
16521670 "<bold>Doc guide</bold>: {}" ,
16531671 STREAM_GUIDE_URL
1654- ) ) ;
1672+ ) )
1673+ . args ( pagination_args ( ) ) ;
16551674 [ declare_cmd, delete_cmd, list_cmd]
16561675 . into_iter ( )
16571676 . map ( |cmd| cmd. infer_long_args ( pre_flight_settings. infer_long_options ) )
@@ -2381,7 +2400,8 @@ fn connections_subcommands(pre_flight_settings: PreFlightSettings) -> Vec<Comman
23812400 . after_help ( color_print:: cformat!(
23822401 "<bold>Doc guide</bold>: {}" ,
23832402 CONNECTION_GUIDE_URL
2384- ) ) ;
2403+ ) )
2404+ . args ( pagination_args ( ) ) ;
23852405 let list_user_connections_cmd = Command :: new ( "list_of_user" )
23862406 . arg (
23872407 Arg :: new ( "username" )
0 commit comments