Skip to content

feat(cli): add explicit --descending sort flag#48

Open
jasonandjay wants to merge 1 commit intoPolymarket:mainfrom
jasonandjay:feat/descending-flag
Open

feat(cli): add explicit --descending sort flag#48
jasonandjay wants to merge 1 commit intoPolymarket:mainfrom
jasonandjay:feat/descending-flag

Conversation

@jasonandjay
Copy link

@jasonandjay jasonandjay commented Mar 15, 2026

Addresses #17

Summary

  • Add explicit --descending flag as counterpart to existing --ascending.
  • Make the flags mutually exclusive via clap conflicts_with.
  • Apply to all list-style commands with sort direction:
    • markets list
    • events list
    • series list
    • sports teams
    • tags list
    • comments list / comments by-user

Notes

  • Behaviour stays backward-compatible: default remains descending.
  • This only improves CLI ergonomics and discoverability.

Note

Low Risk
Low risk CLI-only change: adds a new --descending flag and makes sort-direction flags mutually exclusive without changing default behavior.

Overview
Adds an explicit --descending CLI flag (mutually exclusive with --ascending) across list-style commands (markets, events, series, sports teams, tags, and comments).

Updates request construction so --descending forces ascending=false while preserving the existing default of descending sort when neither flag is provided.

Written by Cursor Bugbot for commit 63fa9a1. This will update automatically on new commits. Configure here.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

.maybe_offset(offset)
.maybe_order(order)
.ascending(ascending)
.ascending(if descending { false } else { ascending })
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant conditional — descending variable has no effect

Low Severity

The expression if descending { false } else { ascending } is equivalent to just ascending in all valid input states, because the conflicts_with constraint guarantees descending and ascending can never both be true. When descending is true, ascending is already false, so the explicit false branch is redundant. The descending variable appears to influence behavior but never does, which is misleading. This pattern is repeated across all six call sites.

Additional Locations (2)
Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant