-
Notifications
You must be signed in to change notification settings - Fork 147
Move non-interactive flag to connect args #906
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
Conversation
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.
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
I think this will be handy |
Probably we can just filter the ports on macOS, e.g. to exclude |
2758442 to
d976b8f
Compare
JurajSadel
left a comment
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, thanks!
MabezDev
left a comment
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.
Thanks!
Moved the
non-interactiveflag toConnectArgsso we also avoid asking the user to select a port. The logic added is the following: When usingnon-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?)