Development record
An unknown flag under --json is refused with no JSON envelope on stdout: abcd ahoy --bogus --json (and any verb) prints cobra's 'abcd: unknown flag: --bogus' on stderr, exits 2 and leaves stdout empty, because the flag parse fails before the persistent --json flag is read, so Run() sees json=false. The --json contract ('a refusal is a {"abcd":"error",...} object on stdout too') is broken for every flag-parse refusal; a machine caller passing an old flag (abcd version --check --json after v0.12.0) reads nothing.
issueresolvedminoriss-2609292352131344
An unknown flag under --json is refused with no JSON envelope on stdout: abcd ahoy --bogus --json (and any verb) prints cobra's 'abcd: unknown flag: --bogus' on stderr, exits 2 and leaves stdout empty, because the flag parse fails before the persistent --json flag is read, so Run() sees json=false. The --json contract ('a refusal is a {"abcd":"error",...} object on stdout too') is broken for every flag-parse refusal; a machine caller passing an old flag (abcd version --check --json after v0.12.0) reads nothing.
Grounds
- pursued: every flag-parse refusal of a --json run is one JSON envelope on stdout with nothing on stderr; shown wrong if any verb's unknown flag followed by --json still prints prose or leaves stdout empty
Frontmatter
| id | iss-2609292352131344 |
|---|---|
| type | issue |
| lifecycle | resolved |
| severity | minor |
.abcd/work/issues/resolved/iss-2609292352131344-an-unknown-flag-under-json-is-refused.md
open on GitHub ↗ · commit history ↗
mentions2
- iss-2609301128211767The loop admits a zero-padded issue key: issueIDRe in internal/core/implement/loop/receipt.go is ^iss-[0-9]{1,20}$, so abcd build iss-02609292352131344 opens a run keyed by the padded spelling, which the brief, the DECISIONS lookup, the branch, the PR title and capture resolve all carry, and which drain's == dedupe of runs misses (review-drainLoop finding 1).
- itd-82`abcd drain` fixes the issues that need no decision, and hands the rest back by kind