IW-552: A flag value beginning with a double dash is refused as missing #788

Open
claude wants to merge 21 commits from IW-552 into main
Member

Summary

A value-taking flag followed by a token that starts with -- was refused as "requires a value", although the value was given. iw issue create --title T --description "--max-turns ..." failed this way; IW-610 hit the same with review-state update --display-subtext "--comments command".

Defects fixed

  • Phase 1 (#787): Rejection.MissingValue conflated "no value was given" with "a value was given but is flag-shaped". The parser now has Rejection.FlagShapedValue(name, token). When the next token is not a flag of this command (and not --help), the refusal names the token and shows the inline form --flag='<token>' that passes it. When the next token is a declared flag of the command or --help, the refusal stays "requires a value" with no inline hint (option a, as answered on the issue). The rule that a -- token is never taken as a separate value is unchanged.

Testing

  • CommandArgParserTest: 7 tests for both rejection shapes (single and repeated flags, inline declared flag, --help).
  • HelpTest: two-line rendering of the new rejection.
  • IssueHarnessTest: issue create with a flag-shaped description asserts the new message, exit 1, no tracker call.
  • Mutation check: reverting the new branch fails exactly the new tests.
  • CI green on the phase PR.

Release notes

See project-management/issues/IW-552/release-notes.md (Czech).

Closes #552

🤖 Generated with Claude Code

## Summary A value-taking flag followed by a token that starts with `--` was refused as "requires a value", although the value was given. `iw issue create --title T --description "--max-turns ..."` failed this way; IW-610 hit the same with `review-state update --display-subtext "--comments command"`. ## Defects fixed - **Phase 1 (#787):** `Rejection.MissingValue` conflated "no value was given" with "a value was given but is flag-shaped". The parser now has `Rejection.FlagShapedValue(name, token)`. When the next token is not a flag of this command (and not `--help`), the refusal names the token and shows the inline form `--flag='<token>'` that passes it. When the next token is a declared flag of the command or `--help`, the refusal stays "requires a value" with no inline hint (option a, as answered on the issue). The rule that a `--` token is never taken as a separate value is unchanged. ## Testing - `CommandArgParserTest`: 7 tests for both rejection shapes (single and repeated flags, inline declared flag, `--help`). - `HelpTest`: two-line rendering of the new rejection. - `IssueHarnessTest`: `issue create` with a flag-shaped description asserts the new message, exit 1, no tracker call. - Mutation check: reverting the new branch fails exactly the new tests. - CI green on the phase PR. ## Release notes See `project-management/issues/IW-552/release-notes.md` (Czech). Closes #552 🤖 Generated with [Claude Code](https://claude.com/claude-code)
A flag value beginning with a double dash cannot be passed, and the refusal
reports it as missing

Artifacts:
- analysis.md

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011M2HjEYoJpcfD43KYP6zxt
Artifacts:
- review-state.json

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011M2HjEYoJpcfD43KYP6zxt
A flag value beginning with a double dash cannot be passed, and the refusal
reports it as missing

Artifacts:
- tasks.md
- review-state.json (tasks_ready)

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011M2HjEYoJpcfD43KYP6zxt
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011M2HjEYoJpcfD43KYP6zxt
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018fPBZaKwU97SaaHzVo3ePq
A flag value beginning with a double dash cannot be passed, and the refusal reports it as missing

Artifacts:
- tasks.md
- issue.md

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018fPBZaKwU97SaaHzVo3ePq
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018fPBZaKwU97SaaHzVo3ePq
Issue: IW-552
Phase: 1 - Rejection.MissingValue conflates "no value was given" with "a value was given but is flag-shaped"

This commit marks the checkpoint for phase 1 context generation.
Use dx-fix IW-552 to return to this point.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rejection.MissingValue conflates "no value was given" with "a value was given but is flag-shaped"

Artifacts:
- phase-01-tasks.md

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
docs(IW-552): release notes
All checks were successful
CI / changes (pull_request) Successful in 5s
CI / contract (pull_request) Has been skipped
CI / format (pull_request) Successful in 10s
CI / lint (pull_request) Successful in 12s
CI / compile (pull_request) Successful in 1m44s
CI / dashboard-build (pull_request) Successful in 1m29s
CI / test (pull_request) Successful in 19m34s
9b37b6a4ba
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mph requested changes 2026-10-11 07:08:53 +00:00
mph left a comment

Conflicting files

Conflicting files
docs(IW-552): rework for final PR review 24
Some checks failed
CI / contract (pull_request) Has been skipped
CI / changes (pull_request) Successful in 4s
CI / compile (pull_request) Successful in 1m4s
CI / format (pull_request) Successful in 10s
CI / lint (pull_request) Successful in 12s
CI / dashboard-build (pull_request) Has been cancelled
CI / test (pull_request) Has been cancelled
7ddf0c9f87
Issue: IW-552
Phase: 2 - Rework for final PR review 24

This commit marks the checkpoint for phase 2 context generation.
Use dx-fix IW-552 to return to this point.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
workflow(dx): Generate Phase 2 tasks for IW-552
All checks were successful
CI / changes (pull_request) Successful in 5s
CI / contract (pull_request) Has been skipped
CI / compile (pull_request) Successful in 1m7s
CI / format (pull_request) Successful in 10s
CI / lint (pull_request) Successful in 10s
CI / dashboard-build (pull_request) Successful in 2m5s
CI / test (pull_request) Successful in 20m22s
3e74dcb739
Rework for final PR review 24

Artifacts:
- phase-02-tasks.md

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Phase 2: Rework for final PR review 24 (#800)
Some checks failed
CI / changes (pull_request) Successful in 4s
CI / contract (pull_request) Has been skipped
CI / format (pull_request) Successful in 11s
CI / lint (pull_request) Successful in 11s
CI / compile (pull_request) Successful in 1m4s
CI / dashboard-build (pull_request) Successful in 1m29s
CI / test (pull_request) Has been cancelled
249f468a38
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merge origin/main into IW-552
All checks were successful
CI / changes (pull_request) Successful in 5s
CI / contract (pull_request) Has been skipped
CI / compile (pull_request) Successful in 1m5s
CI / format (pull_request) Successful in 10s
CI / lint (pull_request) Successful in 11s
CI / dashboard-build (pull_request) Successful in 1m25s
CI / test (pull_request) Successful in 19m14s
9cec329203
Restores the main ancestry that the squash merge of #800 dropped
(see #750). The tree is identical to the parent on IW-552.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Author
Member

Implement: rework for review 24
The rework phase merged into IW-552 through #800; this pull request carries it.

Implement: rework for review 24 The rework phase merged into IW-552 through #800; this pull request carries it.
claude requested review from mph 2026-10-16 17:18:48 +00:00
All checks were successful
CI / changes (pull_request) Successful in 5s
CI / contract (pull_request) Has been skipped
CI / compile (pull_request) Successful in 1m5s
CI / format (pull_request) Successful in 10s
CI / lint (pull_request) Successful in 11s
CI / dashboard-build (pull_request) Successful in 1m25s
CI / test (pull_request) Successful in 19m14s
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin IW-552:IW-552
git switch IW-552

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff IW-552
git switch IW-552
git rebase main
git switch main
git merge --ff-only IW-552
git switch IW-552
git rebase main
git switch main
git merge --no-ff IW-552
git switch main
git merge --squash IW-552
git switch main
git merge --ff-only IW-552
git switch main
git merge IW-552
git push origin main
Sign in to join this conversation.
No description provided.