A bunch of CLI work

This commit is contained in:
Adam Ierymenko 2019-09-30 16:12:08 -07:00
commit 7fc78129f4
No known key found for this signature in database
GPG key ID: C8877CF2D7A5D7F3
19 changed files with 225 additions and 153 deletions

View file

@ -14,9 +14,9 @@
package cli
import (
"encoding/json"
"fmt"
"os"
"zerotier/pkg/zerotier"
)
@ -26,8 +26,7 @@ func Peers(basePath, authToken string, args []string, jsonOutput bool) {
apiGet(basePath, authToken, "/peer", &peers)
if jsonOutput {
j, _ := json.MarshalIndent(&peers, "", " ")
fmt.Println(string(j))
fmt.Println(jsonDump(&peers))
} else {
fmt.Printf("<ztaddr> <ver> <role> <lat> <link> <lastTX> <lastRX> <path(s)>\n")
for _, peer := range peers {