Summary
The global JSON-envelope preprocessor consumes a separated option value when that value is the literal --json-envelope. This corrupts the remaining argument positions before command-specific parsing.
Reproduced with locally built cdidx v1.40.3 from origin/main at 2a1313b87ed361bbabe78eba848b6352cecd3dd0.
Reproduction
$ cdidx search --query --json-envelope --db .cdidx/codeindex.db --json=array
Error: unexpected extra positional 1 argument for search: `.cdidx/codeindex.db`.
The equivalent inline value is not consumed and works:
$ cdidx search --query=--json-envelope --db .cdidx/codeindex.db --count
78
Existing issue relationship
No exact open issue was found.
Expected behavior and scope
Global-option preprocessing must classify token roles before consuming --json-envelope. A token used as the separated value of --query or another value-taking option must remain command data, while an actual global --json-envelope option must keep its current behavior.
Cover separated and inline values, option ordering, the positional -- query form, other value-taking options whose values may equal a global flag, and normal envelope output.
Summary
The global JSON-envelope preprocessor consumes a separated option value when that value is the literal
--json-envelope. This corrupts the remaining argument positions before command-specific parsing.Reproduced with locally built cdidx v1.40.3 from
origin/mainat2a1313b87ed361bbabe78eba848b6352cecd3dd0.Reproduction
The equivalent inline value is not consumed and works:
Existing issue relationship
No exact open issue was found.
Expected behavior and scope
Global-option preprocessing must classify token roles before consuming
--json-envelope. A token used as the separated value of--queryor another value-taking option must remain command data, while an actual global--json-envelopeoption must keep its current behavior.Cover separated and inline values, option ordering, the positional
--query form, other value-taking options whose values may equal a global flag, and normal envelope output.