From a233e775eb54852f311ff7cd40a1375f758e13d6 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Fri, 19 May 2023 20:57:14 +0100 Subject: [PATCH] `yggdrasilctl` tweaks --- cmd/yggdrasilctl/cmd_line_env.go | 1 - cmd/yggdrasilctl/main.go | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/cmd/yggdrasilctl/cmd_line_env.go b/cmd/yggdrasilctl/cmd_line_env.go index be24a55..d96d695 100644 --- a/cmd/yggdrasilctl/cmd_line_env.go +++ b/cmd/yggdrasilctl/cmd_line_env.go @@ -38,7 +38,6 @@ func (cmdLineEnv *CmdLineEnv) parseFlagsAndArgs() { fmt.Println("Examples:") fmt.Println(" - ", os.Args[0], "list") fmt.Println(" - ", os.Args[0], "getPeers") - fmt.Println(" - ", os.Args[0], "-v getSelf") fmt.Println(" - ", os.Args[0], "setTunTap name=auto mtu=1500 tap_mode=false") fmt.Println(" - ", os.Args[0], "-endpoint=tcp://localhost:9001 getDHT") fmt.Println(" - ", os.Args[0], "-endpoint=unix:///var/run/ygg.sock getDHT") diff --git a/cmd/yggdrasilctl/main.go b/cmd/yggdrasilctl/main.go index 884fc05..8f99e0d 100644 --- a/cmd/yggdrasilctl/main.go +++ b/cmd/yggdrasilctl/main.go @@ -176,9 +176,9 @@ func run() int { } table.SetHeader([]string{"URI", "State", "Dir", "IP Address", "Uptime", "RX", "TX", "Pr", "Last Error"}) for _, peer := range resp.Peers { - state, lasterr, dir := "Up", "(none)", "Out" + state, lasterr, dir := "Up", "-", "Out" if !peer.Up { - state, lasterr = "Down", fmt.Sprintf("%s (%s ago)", peer.LastError, peer.LastErrorTime.Round(time.Second)) + state, lasterr = "Down", fmt.Sprintf("%s ago: %s", peer.LastErrorTime.Round(time.Second), peer.LastError) } if peer.Inbound { dir = "In"