Skip to content

feat: add --version flag to all CLI commands (#125)#160

Open
fazalpsinfo-cmyk wants to merge 1 commit into
OpenAgentHQ:mainfrom
fazalpsinfo-cmyk:feat/version-flag-125
Open

feat: add --version flag to all CLI commands (#125)#160
fazalpsinfo-cmyk wants to merge 1 commit into
OpenAgentHQ:mainfrom
fazalpsinfo-cmyk:feat/version-flag-125

Conversation

@fazalpsinfo-cmyk

Copy link
Copy Markdown

Add --version flag to all CLI commands

Previously, oaeval --version worked but oaeval run --version (or any other command with --version after the subcommand) raised a "No such option" error because Typer requires callback options to appear before the subcommand token.

Changes

  1. openagent_eval/cli/main.py — Added _version_aware_cli() wrapper that intercepts --version / -V in any position of sys.argv before Typer processes the arguments.
  2. openagent_eval/cli/utils/callbacks.py — Exported VERSION_OPTION constant for reuse.
  3. pyproject.toml — Updated entry point to _version_aware_cli.

Now oaeval --version, oaeval run --version, oaeval compare --version, etc. all print the version and exit.

Fixes #125


Support my work: If this fix helped, consider buying me a coffee at https://buymeacoffee.com/muhamedfazalps

Previously, OpenAgent Eval v0.4.6 worked but  failed
with a 'No such option' error because Typer callback options must appear
before the subcommand token. Added a  wrapper that
intercepts  /  in any position of sys.argv before Typer
processes the arguments.

Also exported VERSION_OPTION constant from callbacks.py for reuse.

Closes OpenAgentHQ#125
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.

Add --version flag to all CLI commands

1 participant