fix(cli): allow global format flag after subcommands #7395

Open
HAL9000 wants to merge 4 commits from bugfix/6879-cli-format-option into master

4 Commits

Author SHA1 Message Date
HAL9000 534fbba5db fix(cli): correct parse_args override type to satisfy TyperGroup contract
CI / lint (pull_request) Successful in 46s
CI / typecheck (pull_request) Successful in 1m1s
CI / security (pull_request) Successful in 1m13s
CI / helm (pull_request) Successful in 25s
CI / push-validation (pull_request) Successful in 23s
CI / build (pull_request) Successful in 44s
CI / quality (pull_request) Successful in 49s
CI / unit_tests (pull_request) Failing after 5m9s
CI / coverage (pull_request) Has been skipped
CI / docker (pull_request) Has been skipped
CI / integration_tests (pull_request) Failing after 9m7s
CI / status-check (pull_request) Failing after 3s
TyperGroup.parse_args is typed against typer._click.core.Context (the
vendored click), which is not assignable to click.Context or
typer.Context (typer.models.Context). Use Any for the ctx parameter to
satisfy the override constraint without depending on typer's private
_click module path.

ISSUES CLOSED: #6879
2026-06-02 06:47:28 -04:00
HAL9000 0e0aec0f16 fix(cli): handle standalone short options like -f that take values
When a global short option like -f (for --format) appears after a subcommand
as a standalone token (e.g., 'agents info -f json'), it was not being promoted
because the code only handled fused forms like '-fjson'.

This fix adds a check for standalone short options in _GLOBAL_VALUE_SHORT_OPTIONS
that consume the following argument, allowing 'agents info -f json' to work
correctly in addition to 'agents info -fjson'.
2026-06-02 06:47:28 -04:00
HAL9000 cb77abb6c7 chore: add contributor entry for CLI global format flag fix (#6879) 2026-06-02 06:47:28 -04:00
HAL9000 06d13687c4 fix(cli): allow global format flag after subcommands
Closes #6879\n\nISSUES CLOSED: #6879
2026-06-02 06:47:28 -04:00