Skip to content

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

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

Closed
3 tasks done
mphasize opened this issue Nov 2, 2022 · 1 comment · Fixed by #2003
Closed
3 tasks done

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

mphasize opened this issue Nov 2, 2022 · 1 comment · Fixed by #2003
Assignees
Labels
conclusion: resolved Issue was resolved topic: CLI Related to the command line interface topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project

Comments

@mphasize
Copy link

mphasize commented Nov 2, 2022

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
@mphasize mphasize added the type: imperfection Perceived defect in any part of project label Nov 2, 2022
@per1234 per1234 added topic: code Related to content of the project itself topic: CLI Related to the command line interface labels Nov 4, 2022
@cmaglie cmaglie added this to the Arduino CLI 1.0 milestone Nov 30, 2022
@mphasize
Copy link
Author

Thank you @cmaglie 🙏

@per1234 per1234 added the conclusion: resolved Issue was resolved label Jan 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: resolved Issue was resolved topic: CLI Related to the command line interface topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
3 participants