An unquoted multi-word flag value silently fills the next unfilled operand instead of being refused #549
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#549
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?
iw kanon/feedback --description a bparses with title 'b' and description 'a' and files an issue titled 'b', where the previous hand-written parser returned Left("Title is required"). consumeValue takes one token (core/model/CommandArgParser.scala:220-228) and walk then binds the leftover to a free operand slot (:161-168), so a loud refusal became a silent content swap. Bounded to the unfilled-slot case:iw kanon/feedback "Title" --description a bstill reports 'Unexpected argument: b'.Type: bug
Filed from:
/home/mph/ops/kanon-DEVDOCS-246on branchDEVDOCS-246Intake: needs-input
The wrong outcome this issue names is concrete, but the desired rule is not. The parser documents today's behaviour as deliberate ("a bare token binds to the next undeclared operand slot in declaration order"), and it matches GNU/POSIX and clap, so it is not obviously wrong — it only turned a loud "Title is required" into a silent content swap. The recorded IW-463 ruling does not reach this shape. One question:
1. In iw-cli, a command can declare both a positional operand and valued flags (for example
iw feedback <title> --description TEXT;iw start,iw rm,iw gateandiw analyzeare the same shape). Today the parser takes exactly one token as a flag's value and then lets any later bare token fill the next still-empty operand slot, soiw feedback --description a bfiles an issue titled "b" with description "a". Which rule should hold instead?iw feedback --description a b, but also refusesiw start --from main IW-1and every other flag-before-operand invocation that works today.--description a bgives description "a b" and the title is then reported missing. This reverses part of the IW-463 migration.Options (b), (c) and (d) each change the shared parser for all 25 commands, so the answer should be the one you want applied everywhere, not only to
feedback.1: a
Intake: needs-human
Workflow: -
Reason: not actionable — the answer "1: a" keeps the documented operand-binding rule (users quote multi-word flag values), so no change is wanted. Intake closes an issue only against a duplicate issue or a fixing commit, and "working as designed" names neither: close it by hand if you agree.
Analysis: none (no branch)
Working as designed — closed by Michal in a human-review session.
The answer "1: a" keeps the documented operand-binding rule: users quote multi-word flag values. No change is wanted.