Skip to content

hwi: --help response shape diverges from Python HWI 3.2.0 #83

Description

@trevarj

Found while auditing exit statuses for #72. Out of scope there, filed separately.

Pinned Python HWI 3.2.0 treats --help as an error-shaped response: it prints {"error": "Help text requested", "code": -17} on stdout and the help text on stderr, exiting 0 (hwilib/_cli.py:121-126).

BHWI's hwi shim prints plain clap help on stdout with empty stderr, also exiting 0 (bhwi-cli/src/hwi.rs, the DisplayHelp arm of run_cli).

Exit statuses already agree, so this is purely an output-shape divergence. A caller that parses stdout as JSON gets a parse error from BHWI where upstream gives it a -17 object.

Scope

  • Decide whether the shim should reproduce the -17 JSON plus stderr help.
  • If yes, add a parity case; the harness needs a raw-output variant because parse_output bails when stdout is not JSON.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions