fix: honor --raw flag in sprint and epic list - #15
Merged
Merged
Conversation
The --raw flag was registered on both commands via the shared issue list flags and advertised in --help, but never read by their handlers, so --raw still rendered the interactive/table view instead of JSON. Read the flag in the sprint and epic list views and move the JSON printing into cmdutil so all three list commands share one helper. Addresses ankitpokhrel#931.
rethab
added a commit
that referenced
this pull request
Aug 5, 2026
The `--raw` flag is registered on both `sprint list` and `epic list` (inherited from `issue list`) and shows up in `--help`, but neither command ever read it, so `--raw` still rendered the interactive/table view instead of JSON. `epic list` was only half-broken in an easy-to-miss way: piping it happened to work, because the non-TTY branch delegates to the issue list handler, which does honor `--raw`. On a TTY, and for `epic list <KEY>` in every case, the flag was silently ignored. Printing the already-fetched epics directly keeps the piped output identical while fixing the cases that were broken. The JSON printing now lives in `cmdutil` so all three list commands share one helper, rather than `issue list` keeping a private copy and the new callers adding more. Tests drive the real command handlers through the real flag set against a stubbed Jira server, so they cover the flag plumbing that was actually broken — including the `--current`/`--prev`/`--next` paths, where `--raw` has to survive the hand-off to the single-sprint view. Addresses ankitpokhrel#931.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
--rawflag is registered on bothsprint listandepic list(inherited fromissue list) and shows up in--help, but neither command ever read it, so--rawstill rendered the interactive/table view instead of JSON.epic listwas only half-broken in an easy-to-miss way: piping it happened to work, because the non-TTY branch delegates to the issue list handler, which does honor--raw. On a TTY, and forepic list <KEY>in every case, the flag was silently ignored. Printing the already-fetched epics directly keeps the piped output identical while fixing the cases that were broken.The JSON printing now lives in
cmdutilso all three list commands share one helper, rather thanissue listkeeping a private copy and the new callers adding more.Tests drive the real command handlers through the real flag set against a stubbed Jira server, so they cover the flag plumbing that was actually broken — including the
--current/--prev/--nextpaths, where--rawhas to survive the hand-off to the single-sprint view.Addresses ankitpokhrel#931.