A flag value beginning with a double dash cannot be passed, and the refusal reports it as missing #552

Open
opened 2026-09-13 09:08:18 +00:00 by mph · 5 comments
Owner

Passing a value whose first two characters are a double dash makes the parser treat that value as the next flag. Reproduce: iw issue create --title "T" --description "--max-turns is declared with no validate" exits 1 with: Error: --description requires a value. The value is present; the parser reports it as absent. Consequence: a legitimate value that begins with a double dash cannot be passed at all, and the error names the wrong cause. Found while filing kanon follow-ups whose text began with a flag name. Likely site: consumeValue, core/model/CommandArgParser.scala:220-228, the same function behind iw-cli #549 and #550.


Type: bug
Filed from: /home/mph/ops/kanon-DEVDOCS-246 on branch DEVDOCS-246

Passing a value whose first two characters are a double dash makes the parser treat that value as the next flag. Reproduce: iw issue create --title "T" --description "--max-turns is declared with no validate" exits 1 with: Error: --description requires a value. The value is present; the parser reports it as absent. Consequence: a legitimate value that begins with a double dash cannot be passed at all, and the error names the wrong cause. Found while filing kanon follow-ups whose text began with a flag name. Likely site: consumeValue, core/model/CommandArgParser.scala:220-228, the same function behind iw-cli #549 and #550. --- **Type:** bug **Filed from:** `/home/mph/ops/kanon-DEVDOCS-246` on branch `DEVDOCS-246`
Member

Intake: needs-human
Workflow: diagnostic
Reason: G7 — the prescribed hint "Write it inline to pass it: --=" fires for every flag-shaped next token, so a caller who merely forgot a value is told to make the flag the value (--title=--batch); whether the hint is suppressed or reworded for a declared flag of the same command is undecided and changes what gets built
Analysis: project-management/issues/IW-552/analysis.md on branch IW-552

Intake: needs-human Workflow: diagnostic Reason: G7 — the prescribed hint "Write it inline to pass it: --<flag>=<token>" fires for every flag-shaped next token, so a caller who merely forgot a value is told to make the flag the value (--title=--batch); whether the hint is suppressed or reworded for a declared flag of the same command is undecided and changes what gets built Analysis: project-management/issues/IW-552/analysis.md on branch IW-552
Member

Seen again in IW-610: ./iw review-state update --display-subtext "--comments command" fails with 'requires a value' — the parser reads the value as the next flag.

Seen again in IW-610: ./iw review-state update --display-subtext "--comments command" fails with 'requires a value' — the parser reads the value as the next flag.
Member

Intake: needs-input
Workflow: diagnostic
Reason: G7 (1 blocking finding of the analysis review)
Analysis: project-management/issues/IW-552/analysis.md on branch IW-552

  1. [G7] When a flag's value starts with --, the fix refuses it with a second line: "Write it inline to pass it: --=''" (analysis.md:198-202, :359, :362). The review found that this hint fires for every flag-shaped next token, also when the next token is a declared flag of the same command. So iw phase-pr --title --batch (a forgotten title; core/test/PhasePrHarnessTest.scala:1255, test/phase-pr.bats:110) and phase-commit --title --help (core/test/HelpTest.scala:137) would tell the caller to write --title='--batch', that is, to make the flag the title. The analysis refuses its own Hypothesis 3 for exactly this ("makes the common case worse", :255), and then orders both tests changed to assert the bad hint. What should the refusal say when the refused token is a declared flag of this command? Options: a) no inline hint then: only "--title requires a value"; the hint shows only for an undeclared -- token b) a reworded hint for a declared flag, for example "--batch is a flag of this command; if you meant it as the value, write --title='--batch'" c) the hint for every token, as the analysis has it Recommended: a)

Answer in a comment on this issue; intake reads it on its next iteration.

Intake: needs-input Workflow: diagnostic Reason: G7 (1 blocking finding of the analysis review) Analysis: project-management/issues/IW-552/analysis.md on branch IW-552 1. [G7] When a flag's value starts with `--`, the fix refuses it with a second line: "Write it inline to pass it: --<flag>='<token>'" (analysis.md:198-202, :359, :362). The review found that this hint fires for every flag-shaped next token, also when the next token is a declared flag of the same command. So `iw phase-pr --title --batch` (a forgotten title; `core/test/PhasePrHarnessTest.scala:1255`, `test/phase-pr.bats:110`) and `phase-commit --title --help` (`core/test/HelpTest.scala:137`) would tell the caller to write `--title='--batch'`, that is, to make the flag the title. The analysis refuses its own Hypothesis 3 for exactly this ("makes the common case worse", :255), and then orders both tests changed to assert the bad hint. What should the refusal say when the refused token is a declared flag of this command? Options: a) no inline hint then: only "--title requires a value"; the hint shows only for an undeclared `--` token b) a reworded hint for a declared flag, for example "--batch is a flag of this command; if you meant it as the value, write --title='--batch'" c) the hint for every token, as the analysis has it Recommended: a) Answer in a comment on this issue; intake reads it on its next iteration.
Author
Owner

1: a

1: a
Member

Intake: agent-ready
Workflow: diagnostic
Reason: all gates passed
Analysis: project-management/issues/IW-552/analysis.md on branch IW-552

Intake: agent-ready Workflow: diagnostic Reason: all gates passed Analysis: project-management/issues/IW-552/analysis.md on branch IW-552
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#552
No description provided.