Skip to content
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

Normalize similar arguments #759

Merged
merged 10 commits into from
Feb 14, 2025
Merged

Conversation

SergioGasquez
Copy link
Member

I also removed some short arguments that didnt make much sense to me (I can revert those)

@SergioGasquez SergioGasquez linked an issue Feb 11, 2025 that may be closed by this pull request
@SergioGasquez
Copy link
Member Author

Shall I also edit the other places of the codebase where we use offset/addr instead of address and so on..?

@SergioGasquez
Copy link
Member Author

Id like to come up with better names for monitoring args:

  • MonitorConfigArgs has baudrate which can be set with MONITOR_BAUD environment variable
  • ConnectArgs has baud which can be set ESPFLASH_BAUD environment variable

Here is what esptool does: #736

@SergioGasquez
Copy link
Member Author

Id like to come up with better names for monitoring args:

  • MonitorConfigArgs has baudrate which can be set with MONITOR_BAUD environment variable
  • ConnectArgs has baud which can be set ESPFLASH_BAUD environment variable

Here is what esptool does: #736

For the moment, I'm using baud for ConnectArgs and monitor_baud for MonitorConfigArgs. But open to suggestions here

Copy link
Contributor

@JurajSadel JurajSadel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -277,7 +280,7 @@ pub struct MonitorConfigArgs {
#[arg(long, requires = "non_interactive")]
no_reset: bool,
/// Logging format.
#[arg(long, short = 'L', default_value = "serial", requires = "elf")]
#[arg(long, short = 'L', default_value = "serial")]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed the requires because it was failing when using it as a custom runner, since you have the elf from the image, but dont have the elf arg.

You still get a pretty decent error when you do espflash monitor --log-format defmt and dont provide and elf:

❯ cargo r -r --bin espflash -- monitor --log-format defmt
...
Commands:
    CTRL+R    Reset chip
    CTRL+C    Exit

Error: espflash::monitor::defmt::no_elf

  × No elf data available
  help: Please provide an ELF file with the `--elf` argument

But you get that after selecting the port

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we could investigate improving this in #764, since is somewhat similar

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's also an issue in that espflash flash <image> --elf <image> is meaningless, but it's allowed.

Copy link
Member

@jessebraham jessebraham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@jessebraham jessebraham added this pull request to the merge queue Feb 14, 2025
Merged via the queue into esp-rs:main with commit e765bd8 Feb 14, 2025
24 checks passed
@SergioGasquez SergioGasquez deleted the feat/arguments branch February 14, 2025 11:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Normalize similar arguments
4 participants