osfv_cli: cli: replace argparse with typer - #2
Open
iwanicki92 wants to merge 6 commits into
Open
Conversation
Usage, arguments and help should be mostly identical, order might've changed due to the way typer sorts the options. - `--json` argument was moved from global to subcommands where it is used. - Raise on `rte sonoff` failures, previously there was only printed information while code tried to continue - Additionaly fixed issue where 'osfv_cli rte' ignored `--skip-snipeit` command - about 400 less lines of code Signed-off-by: iwanicki92 <iwanicki92@gmail.com>
- Run only after typer validation is done, so heavy setup function doesn't run for command that will fail due to missing argument anyway - Make sure to always check_in assets that were checked_out - Add decorator that'll run setup and queue cleanup to run when required. Signed-off-by: iwanicki92 <iwanicki92@gmail.com>
Signed-off-by: Michał Iwanicki <michal.iwanicki@3mdeb.com>
- Restore reset_cmos command name (Typer default renamed it to reset-cmos) - Fix sonoff --sonoff_ip option, which was mistakenly declared as --rte_ip - Apply with_setup to `spi on` by fixing decorator order, so checkout runs - Restore pwr off/off_ex default press time to 6 seconds - Restore user_add --company-name default (3mdeb) instead of requiring it - Restore required --rom for flash_image_check - Add -j short alias to the per-command --json flags - Add exists=True to `flash write --rom` - Correct power_on_ex docstring (verifies the LED turns on, not off) - Remove dead rte_status function Signed-off-by: Michał Iwanicki <michal.iwanicki@3mdeb.com>
- Append to `failed` instead of reassigning it to the None returned by list.append() - Print the failed assets in the failure message Signed-off-by: Michał Iwanicki <michal.iwanicki@3mdeb.com>
Contributor
|
Fixed couple bugs ( |
macpijan
approved these changes
Jul 29, 2026
Collaborator
|
Let's wait for @artur-rs with merging this. |
Signed-off-by: iwanicki92 <iwanicki92@gmail.com>
Author
|
I forgot to run pre-commit previously, I updated the hooks and fixed the issues. |
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.
Usage, arguments and help should be mostly identical, order might've changed due to the way typer sorts the options.
--jsonargument was moved from global to subcommands where it is used (can readd if required to not break API).rte sonofffailures, previously there was only printed information while code tried to continue--skip-snipeitcommandI wanted to fix
--skip-snipeitissue I noticed in 3mdeb/meta-rte#103, but when I saw how the CLI looked like (hundreds of lines ofargparseand 200 lines ofif/elseif) I decided to replace it first. Incidentally I also fixed the original issue. A lot of changes, but I think this will be easier to maintain.osfv_cli -h:osfv_cli rte -h:@macpijan