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
bjoernQ
left a comment
There was a problem hiding this comment.
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
flashsubcommand.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
arginstead ofopt, as their types are evenclap::Arg.Additionally I have created a
clifeature which all CLI-related dependencies are gated behind. This allows these packages to be excluded when usingespflashas a library. This feature is enabled by default. The executable was renamed frommain.rstobin/espflash.rsto 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