A flag value beginning with a double dash cannot be passed, and the refusal reports it as missing #552
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
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
iterative-works/iw-cli#552
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?
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-246on branchDEVDOCS-246Intake: 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
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.
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
--, 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. Soiw phase-pr --title --batch(a forgotten title;core/test/PhasePrHarnessTest.scala:1255,test/phase-pr.bats:110) andphase-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.
1: a
Intake: agent-ready
Workflow: diagnostic
Reason: all gates passed
Analysis: project-management/issues/IW-552/analysis.md on branch IW-552