From 468677c23c07bfb40cff54a8069a3e2464ea22f4 Mon Sep 17 00:00:00 2001 From: delbonis Date: Fri, 30 Nov 2018 12:50:47 -0500 Subject: [PATCH 1/3] Cleaned up some redundancies in the lit-af ls command. --- cmd/lit-af/shell.go | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/cmd/lit-af/shell.go b/cmd/lit-af/shell.go index 8c66b1146..0085887ff 100644 --- a/cmd/lit-af/shell.go +++ b/cmd/lit-af/shell.go @@ -343,24 +343,11 @@ func (lc *litAfClient) Ls(textArgs []string) error { } } - err = lc.Call("LitRPC.Balance", nil, bReply) - if err != nil { - return err - } - walHeights := map[uint32]int32{} for _, b := range bReply.Balances { walHeights[b.CoinType] = b.SyncHeight } - err = lc.Call("LitRPC.ChannelList", nil, cReply) - if err != nil { - return err - } - if len(cReply.Channels) > 0 { - fmt.Fprintf(color.Output, "\t%s\n", lnutil.Header("Channels:")) - } - if cmd == "chans" || displayAllCommands { err := lc.Call("LitRPC.ChannelList", nil, cReply) if err != nil { @@ -368,9 +355,8 @@ func (lc *litAfClient) Ls(textArgs []string) error { } if len(cReply.Channels) > 0 { - if displayAllCommands { - fmt.Fprintf(color.Output, "\t%s\n", lnutil.Header("Channels:")) - } + + fmt.Fprintf(color.Output, "\t%s\n", lnutil.Header("Channels:")) coinDaemonConnected := map[uint32]bool{} for _, walBal := range bReply.Balances { From 91af263cf9595bc748f3319b422269dddc22a20d Mon Sep 17 00:00:00 2001 From: delbonis Date: Fri, 30 Nov 2018 13:12:23 -0500 Subject: [PATCH 2/3] Tweaked help output to make it easier to understand I think. --- cmd/lit-af/shell.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/lit-af/shell.go b/cmd/lit-af/shell.go index 0085887ff..005270cca 100644 --- a/cmd/lit-af/shell.go +++ b/cmd/lit-af/shell.go @@ -620,7 +620,7 @@ func printHelp(commands []*Command) { func printCointypes() { for k, v := range coinparam.RegisteredNets { fmt.Fprintf(color.Output, "CoinType: %s\n", strconv.Itoa(int(k))) - fmt.Fprintf(color.Output, "└────── Name: %-13sBech32Prefix: %s\n\n", v.Name+",", v.Bech32Prefix) + fmt.Fprintf(color.Output, "└────── Name: %-13s, Bech32Prefix: %s\n\n", v.Name, v.Bech32Prefix) } } From c21dc09e9136b3cc880886cdc4913d1f582b6142 Mon Sep 17 00:00:00 2001 From: delbonis Date: Fri, 30 Nov 2018 13:49:12 -0500 Subject: [PATCH 3/3] Fixed ls help message. --- cmd/lit-af/shell.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/lit-af/shell.go b/cmd/lit-af/shell.go index 005270cca..d49fc32f0 100644 --- a/cmd/lit-af/shell.go +++ b/cmd/lit-af/shell.go @@ -25,7 +25,7 @@ var lsCommand = &Command{ "What information to show. Provide one of:"), fmt.Sprintf("\t%-20s %s", lnutil.White("-a"), - "Information on connections to other peers"), + "Everything"), fmt.Sprintf("\t%-20s %s", lnutil.White("conns"), "Information on connections to other peers"),