Skip to content

Conversation

@SergioGasquez
Copy link
Member

@SergioGasquez SergioGasquez commented Jun 26, 2025

Moved the non-interactive flag to ConnectArgs so we also avoid asking the user to select a port. The logic added is the following: When using non-interactive, it will use any of the selected ports (via flag, environment variable or config file) and if no port was selected it will: Detect the number of ports, if there is only one, it will use this one, if there are multiple ports it will throw an error (MacOs usually duplicates ports so its not ideal, maybe we should error if >2 on macos?)

@SergioGasquez SergioGasquez linked an issue Jun 26, 2025 that may be closed by this pull request
@SergioGasquez SergioGasquez requested a review from MabezDev June 26, 2025 08:47
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.

I've tried to run some test locally:

./espflash/tests/scripts/save-image_write-bin.sh --port /dev/cu.usbmodem11401  --non-interactive esp32s3
error: unexpected argument '--port' found

  tip: a similar argument exists: '--format'

Usage: espflash save-image --chip <CHIP> --merge --format <FORMAT> <IMAGE> <FILE>

For more information, try '--help'.espflash git:(1aa4970)./espflash/tests/scripts/save-image_write-bin.sh -p /dev/cu.usbmodem11401  --non-interactive esp32s3
error: unexpected argument '-p' found

  tip: to pass '-p' as a value, use '-- -p'

Usage: espflash save-image [OPTIONS] --chip <CHIP> <IMAGE> <FILE>

For more information, try '--help'.

Am I missing something here?

EDIT: Solved offline, the correct way of running test locally:
ESPFLASH_PORT=/dev/cu.usbmodem11401 ./espflash/tests/scripts/save-image_write-bin.sh esp32s3

@JurajSadel
Copy link
Contributor

MacOs usually duplicates ports so its not ideal, maybe we should error if >2 on macos?

I think this will be handy

@jessebraham
Copy link
Member

MacOs usually duplicates ports so its not ideal, maybe we should error if >2 on macos?

Probably we can just filter the ports on macOS, e.g. to exclude tty.*, rather than allowing 2 ports.

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, thanks!

Copy link
Member

@MabezDev MabezDev left a comment

Choose a reason for hiding this comment

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

Thanks!

@SergioGasquez SergioGasquez added this pull request to the merge queue Jun 27, 2025
Merged via the queue into esp-rs:main with commit 2e3f3c3 Jun 27, 2025
25 checks passed
@SergioGasquez SergioGasquez deleted the fix/non-interactive branch June 27, 2025 14:43
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.

--non-interactive not working correctly

4 participants