Skip to content

fix: honor --raw flag in sprint and epic list - #15

Merged
rethab merged 1 commit into
mainfrom
fix/issue-931
Jul 12, 2026
Merged

fix: honor --raw flag in sprint and epic list#15
rethab merged 1 commit into
mainfrom
fix/issue-931

Conversation

@rethab

@rethab rethab commented Jul 12, 2026

Copy link
Copy Markdown
Owner

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.

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 rethab changed the title fix: sprint list should honor --raw flag fix: honor --raw flag in sprint and epic list Jul 12, 2026
@rethab
rethab merged commit 711facd into main Jul 12, 2026
1 check passed
@rethab
rethab deleted the fix/issue-931 branch July 12, 2026 06:44
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.
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