Repository navigation
fix(cli): add --version flag, version command, and make progress spinner TTY-aware (#119) - #127
Closed
dianatofficial wants to merge 1 commit into
Closed
dianatofficial wants to merge 1 commit into
dianatofficial wants to merge 1 commit into
Conversation
Collaborator
|
Closing this without merging. #126 already landed the fix for #119 on main ( A few differences worth keeping in mind:
#119 stays open. |
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.
Summary
Addresses all three CLI defects reported in #119:
Version flag & command:
--version/-voption to the root Typer callback (secfoo --versionandsecfoo -v).secfoo versioncommand andsecfoo version --jsonoutputting structured environment details (version,python,platform,store_path,config_path).--versionandversion --jsonindocs/REFERENCE.md.TTY-aware progress spinner:
_is_stdout_tty()to detect whether stdout is an actual terminal, regardless ofFORCE_COLORsetting.Progressspinner is disabled, preventing tens of kilobytes of cursor redraw escape frames (\x1b[2K,\x1b[1A,\x1b[?25) from flooding captured logs.Deduplicated completion lines:
--jsonmode, retains pure byte-exact JSON on stdout without progress lines.Verification
tests/test_cli.py:test_version_flag: assertssecfoo --versionand-vexit 0 with version text.test_version_command: assertssecfoo versionoutput.test_version_command_json: parses and validates all JSON keys (version,python,platform,store_path,config_path).test_non_tty_run_no_spinner_flooding_and_no_duplicate_completion: asserts no cursor-movement escapes underFORCE_COLOR=1, compact byte count (<2.5 KB), and single occurrence of start/completion lines.test_json_run_suppresses_progress_lines: asserts byte-exact JSON document parsing.tests/test_cli.pypass cleanly.ruff.Fixes #119