Skip to content
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

Add json output to daemon command #1585

Merged
merged 1 commit into from
Dec 7, 2021
Merged

Conversation

silvanocerza
Copy link
Contributor

Please check if the PR fulfills these requirements

  • The PR has no duplicates (please search among the Pull Requests
    before creating one)
  • The PR follows
    our contributing guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • UPGRADING.md has been updated with a migration guide (for breaking changes)
  • What kind of change does this PR introduce?

Adds json output to an existing command.

  • What is the current behavior?

Calling arduino-cli daemon --format json would produce no output.

  • What is the new behavior?

Calling arduino-cli daemon --format json now prints the IP and port used:

$ arduino-cli daemon --format json
{
  "IP": "127.0.0.1",
  "Port": "50051"
}

This might be useful when the client lets us choose the port used randomly by setting it to 0:

$ arduino-cli daemon --port 0 --format json 
{
  "IP": "127.0.0.1",
  "Port": "44885"
}

$ arduino-cli daemon --port 0 --format json 
{
  "IP": "127.0.0.1",
  "Port": "33395"
}

Nope.

  • Other information:

Closes #1583.


See how to contribute

@silvanocerza silvanocerza added type: enhancement Proposed improvement topic: code Related to content of the project itself topic: CLI Related to the command line interface labels Dec 7, 2021
@silvanocerza silvanocerza self-assigned this Dec 7, 2021
@silvanocerza silvanocerza merged commit 2067504 into master Dec 7, 2021
@silvanocerza silvanocerza deleted the scerza/daemon-json-output branch December 7, 2021 16:00
umbynos pushed a commit that referenced this pull request Dec 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: CLI Related to the command line interface topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

daemon command should print to json the port used
2 participants