Improve CLI Help and Argument Handling in update_firmware.py#33
Open
ChasonDeshotel wants to merge 1 commit intobeacon3d:masterfrom
Open
Improve CLI Help and Argument Handling in update_firmware.py#33ChasonDeshotel wants to merge 1 commit intobeacon3d:masterfrom
ChasonDeshotel wants to merge 1 commit intobeacon3d:masterfrom
Conversation
Add descriptive help text, usage examples, and behavioral notes Prints full help message when no subcommand is given Remove globals() dispatch in favor of an explicit dict-based dispatch table Standardize output messages across check and update tasks
4450110 to
38afa2f
Compare
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.
✨ Improvements to
update_firmware.pyEnhancements:
Example behavior:
$ python3 update_firmware.py usage: update_firmware.py [-h] {check,update} ... Beacon firmware updater Examples: update_firmware.py check /dev/serial/by-id/... update_firmware.py update /dev/serial/by-id/... Notes: - 'check' produces no output if firmware is up-to-date - 'update' uses 'sudo' unless --no-sudo is specified - Use --force to flash even if the firmware appears current positional arguments: {check,update} Available commands check Check if firmware is up to date update Update firmware options: -h, --help Show this help message and exitWhy?
Because I had to read code to see if returning nothing meant success
This change is low risk and improves clarity and maintainability