Skip to content

Fix JSON output capture for Click option sources - #162

Merged
codeforester merged 1 commit into
mainfrom
bug/139-20260807-json-capture
Aug 7, 2026
Merged

Fix JSON output capture for Click option sources#162
codeforester merged 1 commit into
mainfrom
bug/139-20260807-json-capture

Conversation

@codeforester

Copy link
Copy Markdown
Contributor

Summary

  • Capture stdout whenever a lifecycle JSON option is configured.
  • Let Click's parsed lifecycle value determine envelope emission.
  • Cover combined short flags and default_map activation paths.

Why

Raw argv scanning misses valid Click option forms such as -xj and default_map, allowing command prose to precede the JSON envelope.

Validation

  • pytest -q tests/test_json_contracts.py
  • git diff --check

Closes #139

@codeforester
codeforester merged commit b98833f into main Aug 7, 2026
80 checks passed
@codeforester
codeforester deleted the bug/139-20260807-json-capture branch August 7, 2026 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

--json output mode is guessed via naive argv scanning, allowing prose+JSON to both land on stdout

1 participant