review-state update should support --help flag #202

Closed
opened 2026-02-17 09:30:34 +00:00 by mprihoda · 2 comments
mprihoda commented 2026-02-17 09:30:34 +00:00 (Migrated from github.com)

Running './iw review-state update --help' currently executes a default update instead of showing usage information. It should display available options (--status, --display-text, --display-subtext, --display-type, --message, --needs-attention, --pr-url, --append-badge, --append-artifact, --append-action, --checkpoint, --input) and exit without modifying any state.

Running './iw review-state update --help' currently executes a default update instead of showing usage information. It should display available options (--status, --display-text, --display-subtext, --display-type, --message, --needs-attention, --pr-url, --append-badge, --append-artifact, --append-action, --checkpoint, --input) and exit without modifying any state.
Owner

Superseded by #463, which requires a --help on every subcommand, dispatched before the action so it can never perform an update. Closing in favour of #463.

Superseded by #463, which requires a --help on every subcommand, dispatched before the action so it can never perform an update. Closing in favour of #463.
mph closed this issue 2026-08-27 08:05:57 +00:00
Owner

Delivered in IW-463 Phase 6.

iw review-state update --help now prints the update subcommand's own rendered help at a real terminal and exits 0, modifying nothing:

Usage: iw review-state update [--issue-id ID] [--status STATUS] [--clear-status] ...

Every flag this issue listed is named, with what it does and how its absence resolves, together with the exit codes and an example. The help is rendered from ReviewState's declaration, which the parser reads too, so the two cannot say different things.

How it is reached: the launcher's pre-filter fires on an exact --help or -h token, resolves the command, and hands the caller's own argv to iw.core.commands.Help. That walks CommandArgParser.dispatch down through the subcommands, so update is reached by exactly the tokens that reach it when the command runs — no second resolution rule. Dispatch happens before any action, so the update can never be performed on a help request.

Covered at two tiers: core/test/HelpTest.scala asserts the declaration reached is review-state update (not a string the parent's help also renders), and test/help-intercept.bats case 4c asserts the same invocation end to end through iw-run.

This issue was already closed on 2026-08-27 as superseded by #463; it stays closed. This comment records that the behaviour it asked for now exists.

Delivered in IW-463 Phase 6. `iw review-state update --help` now prints the `update` subcommand's own rendered help at a real terminal and exits 0, modifying nothing: Usage: iw review-state update [--issue-id ID] [--status STATUS] [--clear-status] ... Every flag this issue listed is named, with what it does and how its absence resolves, together with the exit codes and an example. The help is rendered from `ReviewState`'s declaration, which the parser reads too, so the two cannot say different things. How it is reached: the launcher's pre-filter fires on an exact `--help` or `-h` token, resolves the command, and hands the caller's own argv to `iw.core.commands.Help`. That walks `CommandArgParser.dispatch` down through the subcommands, so `update` is reached by exactly the tokens that reach it when the command runs — no second resolution rule. Dispatch happens before any action, so the update can never be performed on a help request. Covered at two tiers: `core/test/HelpTest.scala` asserts the declaration reached is `review-state update` (not a string the parent's help also renders), and `test/help-intercept.bats` case 4c asserts the same invocation end to end through `iw-run`. This issue was already closed on 2026-08-27 as superseded by #463; it stays closed. This comment records that the behaviour it asked for now exists.
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
iterative-works/iw-cli#202
No description provided.