Skip to content

Commit 3a8ef1d

Browse files
committed
fix: correct sort order default to descending (#17)
- Changed default sort direction from ascending to descending for markets and events list commands - When --ascending flag is NOT provided: sorts in descending order (default behavior) - When --ascending flag IS provided: sorts in ascending order (explicit override) - Help text already stated 'Sort ascending instead of descending', implying descending is default - Fixes issue where --ascending flag was a no-op and no way to get descending results
1 parent 3ba646b commit 3a8ef1d

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/commands/events.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ pub async fn execute(client: &gamma::Client, args: EventsArgs, output: OutputFor
7979
.limit(limit)
8080
.maybe_closed(resolved_closed)
8181
.maybe_offset(offset)
82-
.maybe_ascending(if ascending { Some(true) } else { None })
82+
.maybe_ascending(if ascending { Some(true) } else { Some(false) })
8383
.maybe_tag_slug(tag)
8484
.order(order.into_iter().collect::<Vec<_>>())
8585
.build();

src/commands/markets.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ pub async fn execute(
9595
.maybe_closed(resolved_closed)
9696
.maybe_offset(offset)
9797
.maybe_order(order)
98-
.maybe_ascending(if ascending { Some(true) } else { None })
98+
.maybe_ascending(if ascending { Some(true) } else { Some(false) })
9999
.build();
100100

101101
let markets = client.markets(&request).await?;

0 commit comments

Comments
 (0)