Skip to content

CLI upload command seems to ignore "--format json" option #1961

Closed
@mphasize

Description

@mphasize

Describe the problem

When running arduino-cli upload [...] --format json the CLI command doesn't respond with JSON output on the command line. A successful run seems to return no output, while errors are simply written to stdout.

To reproduce

Open the terminal and upload any sketch with the --format json option.

For example: arduino-cli upload /home/user/Arduino/MySketch --format json

In my specific case:

arduino-cli upload -p /usb/usbmode4133 --fqbn "arduino:avr:uno" -i ./assets/arduino/firmwares/uno/StandardFirmataPlus.hex --format json
avrdude: ser_open(): can't open device "/usb/usbmode4133": No such file or directory
Error during Upload: Failed uploading: uploading error: exit status 1

Expected behavior

If the upload was successful, there should be a positive response encoded as JSON, for example:

{
  "uploaded": true, 
  "verified": false, 
  "sketchName": "MyExample.ino"
}

If there were errors, the errors should be displayed in a JSON format, not simple text.

Arduino CLI version

Version: 0.28.0 Commit: 06fb190 Date: 2022-10-18T15:53:04Z

Operating system

macOS

Operating system version

macOS 12.6

Additional context

No response

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the nightly build
  • My report contains all necessary details

Metadata

Metadata

Assignees

Labels

conclusion: resolvedIssue was resolvedtopic: CLIRelated to the command line interfacetopic: codeRelated to content of the project itselftype: imperfectionPerceived defect in any part of project

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions