Declare mutually exclusive switches in CommandArgParser instead of an inline check per command #598
Labels
No labels
agent-ready
bug
contract
documentation
duplicate
enhancement
good first issue
help wanted
invalid
needs-human
needs-input
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
iterative-works/iw-cli#598
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found while working IW-581.
Two commands refuse a pair of switches with an inline check of their own:
PhasePrrefuses--batchwith--no-wait.Startrefuses--no-agentwith--prompt(added by IW-581).Each check is written, tested and documented by hand:
Starthas its own refusal text, its own exit-code line inCommandHelp, and two harness tests that check both orders. The next command with such a pair repeats all of it.PROPOSED FIX. Let
CommandArgParser/CommandHelpdeclare a set of mutually exclusive switches. The parser refuses the pair beforerundoes anything, with one standard message, and the help lists the exclusion. The inline checks inPhasePrandStartthen go.Related: #569 proposes to make the
PhasePrpair unrepresentable with a sum type. That is a different fix for one of the two cases; a decision on #569 affects the scope of this issue.--timeout --wip --timeout 10mgivesFlagShapedValue("--timeout", "--wip");CommandArgParser.parsedoc says only the last occurrence "is validated" (review-phase-02-20261015-150758.md, testing) (from IW-552)Intake: agent-ready
Workflow: waterfall
Reason: all gates passed
Analysis: project-management/issues/IW-598/analysis.md on branch IW-598
Implement: needs-human
Reason: batch-implement exit 1 — the kanon plugin does not compile against the iw-cli core of this branch, so no phase ran
ForgeCatchUp.scalain the installed kanon plugin expectsfetchPullRequestForBranchto returnEither[String, _]. The iw-cli core onmainreturnsEither[TrackerError, _]since #778. The failure is in the plugin, not in this issue: every iw-cli issue stops at the same place until the plugin is updated. batch-implement.log was not written. The command output:After the plugin compiles against iw-cli
main, putagent-readyback on this issue.Release: the implement loop failed this issue for a reason outside it. The kanon plugin did not compile against iw-cli main, because the tracker port now returns TrackerError (iw-cli #778). The plugin fix is dev-docs #484, and iw-cli 0.22.1 carries the core change. The issue goes back to the implement loop.