-
-
Notifications
You must be signed in to change notification settings - Fork 422
Added upload --upload-field key=value
flag to set upload fields value
#2348
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
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@ ## master #2348 +/- ## ========================================== - Coverage 62.91% 62.82% -0.10% ========================================== Files 203 204 +1 Lines 19249 19307 +58 ========================================== + Hits 12110 12129 +19 - Misses 6080 6118 +38 - Partials 1059 1060 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
00b2a3a
to
47a858e
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, please integrate this new feature in the docs
e3ce8b5
to
16d2531
Compare
I've added a KeyValue type by implementing the cobra.Value
interface. This makes the help a little more self-explanatory:
Upload Arduino sketches. This does NOT compile the sketch prior to upload.
Usage:
arduino-cli upload [flags]
Examples:
arduino-cli upload /home/user/Arduino/MySketch -p /dev/ttyACM0 -b arduino:avr:uno
arduino-cli upload -p 192.168.10.1 -b arduino:avr:uno --upload-field password=abc
Flags:
--board-options strings List of board options separated by commas. Or can be used multiple times for multiple options.
--discovery-timeout duration Max time to wait for port discovery, e.g.: 30s, 1m (default 1s)
-b, --fqbn string Fully Qualified Board Name, e.g.: arduino:avr:uno
-h, --help help for upload
--input-dir string Directory containing binaries to upload.
-i, --input-file string Binary file to upload.
-p, --port string Upload port address, e.g.: COM3 or /dev/ttyACM2
-m, --profile string Sketch profile to use
-P, --programmer string Programmer to use, e.g: atmel_ice
-l, --protocol string Upload port protocol, e.g: serial
-F, --upload-field key=value Set a value for a field required to upload.
-t, --verify Verify uploaded binary after the upload.
Global Flags:
--additional-urls strings Comma-separated list of additional URLs for the Boards Manager.
--config-file string The custom config file (if not specified the default will be used).
--format string The output format for the logs, can be: text, json, jsonmini, yaml (default "text")
--log Print the logs on the standard output.
--log-file string Path to the file where logs will be written.
--log-format string The output format for the logs, can be: text, json
--log-level string Messages with this level and above will be logged. Valid levels are: trace, debug, info, warn, error, fatal, panic
--no-color Disable colored output.
The other benefit is that the flag syntax check is performed much earlier in the parsing process:
$ arduino-cli upload -F password
Error: invalid argument "password" for "-F, --upload-field" flag: required format is 'key=value'
[....]
$ arduino-cli upload -F =value
Error: invalid argument "=value" for "-F, --upload-field" flag: key cannot be empty
[...]
$ arduino-cli upload -F password=value -F password=another
Error: invalid argument "password=another" for "-F, --upload-field" flag: duplicate key: password
[...]
and finally, we get directly a map[string]string
without further processing on the CLI side.
16d2531
to
088850c
Compare
upload --upload-field key=value
flag to set upload fields value (追記ここまで)
Uh oh!
There was an error while loading. Please reload this page.
Please check if the PR fulfills these requirements
See how to contribute
before creating one)
our contributing guidelines
UPGRADING.md
has been updated with a migration guide (for breaking changes)configuration.schema.json
updated if new parameters are added.What kind of change does this PR introduce?
Adds a
--upload-field
flag to theupload
command to set upload fields directly from the command line.What is the current behavior?
The upload fields must be entered interactively via terminal.
What is the new behavior?
The upload fields may be passed via
--upload-field field=value
flag.Does this PR introduce a breaking change, and is titled accordingly?
No
Other information
Fix #2270