Skip to content

Commit 836513b

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 836513b

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

src/commands/comments.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ pub async fn execute(
112112
.limit(limit)
113113
.maybe_offset(offset)
114114
.maybe_order(order)
115-
.maybe_ascending(if ascending { Some(true) } else { None })
115+
.maybe_ascending(if ascending { Some(true) } else { Some(false) })
116116
.build();
117117

118118
let comments = client.comments(&request).await?;
@@ -150,7 +150,7 @@ pub async fn execute(
150150
.limit(limit)
151151
.maybe_offset(offset)
152152
.maybe_order(order)
153-
.maybe_ascending(if ascending { Some(true) } else { None })
153+
.maybe_ascending(if ascending { Some(true) } else { Some(false) })
154154
.build();
155155

156156
let comments = client.comments_by_user_address(&request).await?;

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?;

src/commands/series.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ pub async fn execute(client: &gamma::Client, args: SeriesArgs, output: OutputFor
5959
.limit(limit)
6060
.maybe_offset(offset)
6161
.maybe_order(order)
62-
.maybe_ascending(if ascending { Some(true) } else { None })
62+
.maybe_ascending(if ascending { Some(true) } else { Some(false) })
6363
.maybe_closed(closed)
6464
.build();
6565

0 commit comments

Comments
 (0)