mirror of
https://github.com/ZeroTier/ZeroTierOne
synced 2025-08-14 02:27:38 -07:00
A bunch of CLI work
This commit is contained in:
parent
c4504fd3ff
commit
7fc78129f4
19 changed files with 225 additions and 153 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue