fix(cli): support non-interactive help and gated hardware test#434
Open
melxusgid wants to merge 2 commits into
Open
fix(cli): support non-interactive help and gated hardware test#434melxusgid wants to merge 2 commits into
melxusgid wants to merge 2 commits into
Conversation
|
You are welcome to add an entry to the CHANGELOG.md as well |
Built artifacts for commit e6f06c9FirmwareClient |
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
This PR makes two small CLI/test hygiene improvements:
argparseentrypoint forchameleon_cli_main.py, so--helpworks without starting the interactiveprompt_toolkitprompt.CHAMELEON_PORTinstead of hardcodingcom19and/dev/ttyACM0.It also adds a small one-shot command mode:
python script/chameleon_cli_main.py --command "rem hello"Why
Before this change, running CLI help from a non-interactive environment could enter the interactive prompt path instead of printing help cleanly. This is inconvenient for scripts, CI, and automation.
The hardnested acquisition test also failed on machines where the device is not available at
com19or/dev/ttyACM0. On macOS, for example, Chameleon Ultra commonly appears as a/dev/cu.usbmodem...device.With this change, hardware tests only run when a port is explicitly provided:
If
CHAMELEON_PORTis not set, the test is skipped instead of failing due to a missing hardcoded port.Test plan
Ran from
software/against a plugged-in Chameleon Ultra on macOS:The hardware test failure is expected —
HF tag no found or lostmeans the device connected and tried to scan, but no Mifare Classic tag was physically present on the reader.Also verified manually:
Expected behavior:
--helpprints usage and exits 0.--commandexecutes a one-shot CLI command and exits 0.prompt_toolkit.Notes
This PR intentionally avoids changing RFID behavior. It only improves automation ergonomics and test portability.