feat: add --version flag to all CLI commands (#125)#160
Open
fazalpsinfo-cmyk wants to merge 1 commit into
Open
feat: add --version flag to all CLI commands (#125)#160fazalpsinfo-cmyk wants to merge 1 commit into
fazalpsinfo-cmyk wants to merge 1 commit into
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add --version flag to all CLI commands
Previously,
oaeval --versionworked butoaeval run --version(or any other command with--versionafter the subcommand) raised a "No such option" error because Typer requires callback options to appear before the subcommand token.Changes
openagent_eval/cli/main.py— Added_version_aware_cli()wrapper that intercepts--version/-Vin any position ofsys.argvbefore Typer processes the arguments.openagent_eval/cli/utils/callbacks.py— ExportedVERSION_OPTIONconstant for reuse.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 ☕