-
Notifications
You must be signed in to change notification settings - Fork 128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Re-design the CLI interface #239
Conversation
hi @jessebraham I come here via esp-rs chat channel. Its clear that I'm totally newbie, so please forgive if I have some naive questions 😅. Is there any reasons you decided to switch from |
@hnidoaht-101 for context,
|
Haven't looked much into this yet but definitely thumbs-up for adding a |
…nd checking for updates
…d as a Cargo runner
…where they belong
2720fea
to
0c63abf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - also I'm using it for a few days without issues
Maybe we should bump the version in this PR already? No needed but I think it would be nice
Thanks for taking a look! I wasn't sure when to bump the version, I can set it to |
This PR includes a re-design of the command-line interface, most notably adding a
flash
subcommand.In the current interface, since there is no flashing subcommand, it's possible to pass arguments before a subcommand which are accepted but silently ignored. This is bad UX and is a common source of confusion for users. Adding a flashing subcommand eliminates this issue entirely.
While I was breaking things, I did a bit of refactoring as well. This was mostly just moving types to the module they belong in, simplifying some functions, etc. Nothing too interesting. I've also renamed a number of types/fields/functions/etc. to be more in line with other parts of the code, eg.) CLI arguments now use
arg
instead ofopt
, as their types are evenclap::Arg
.Additionally I have created a
cli
feature which all CLI-related dependencies are gated behind. This allows these packages to be excluded when usingespflash
as a library. This feature is enabled by default. The executable was renamed frommain.rs
tobin/espflash.rs
to accommodate this.Beyond addressing whatever changes are requested, I'm not sure that there is much more to add to this PR. There are additional UX-related changes I would like to make but they are out of scope and deserve their own PRs, I think.
I would like to spend some time reviewing this and really picking it apart before we merge it. I have marked this as a draft until I am comfortable with its state. Small details such as short/long names, docstrings (which are displayed in help messages) and argument names are important, so please nitpick!
Closes #222
Closes #236