Skip to content

Commit

Permalink
Added machine-readable IP:PORT in text-mode 'daemon' (arduino#2101)
Browse files Browse the repository at this point in the history
  • Loading branch information
cmaglie authored Mar 10, 2023
1 parent fed439a commit 6992de7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/cli/daemon/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
package daemon

import (
"encoding/json"
"errors"
"fmt"
"net"
Expand Down Expand Up @@ -173,5 +174,6 @@ func (r daemonResult) Data() interface{} {
}

func (r daemonResult) String() string {
return tr("Daemon is now listening on %s:%s", r.IP, r.Port)
j, _ := json.Marshal(r)
return fmt.Sprintln(tr("Daemon is now listening on %s:%s", r.IP, r.Port)) + fmt.Sprintln(string(j))
}

0 comments on commit 6992de7

Please sign in to comment.