Skip to content

Commit

Permalink
update cli
Browse files Browse the repository at this point in the history
  • Loading branch information
ericxtang committed Nov 28, 2017
1 parent 00071cb commit d5842ca
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions cmd/livepeer_cli/livepeer_cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func (w *wizard) run() {
fmt.Println("+-----------------------------------------------------------+")
fmt.Println()

w.stats(false)
w.stats(w.transcoder)
// Basics done, loop ad infinitum about what to do
for {

Expand Down Expand Up @@ -202,7 +202,7 @@ func (w *wizard) run() {
}
switch {
case choice == NodeStatus:
w.stats(false)
w.stats(w.transcoder)
case choice == DepositToken:
w.deposit()
case choice == BroadcastVideo:
Expand Down
3 changes: 2 additions & 1 deletion cmd/livepeer_cli/wizard_broadcast.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"os"
"os/exec"
"runtime"
"strings"
"text/tabwriter"
"time"

Expand Down Expand Up @@ -78,7 +79,7 @@ func (w *wizard) broadcast() {
fmt.Printf("Current RTMP setting: http://localhost:%v/streams\n", w.rtmpPort)
fmt.Printf("Current HTTP setting: http://localhost:%v/streams\n", w.httpPort)
fmt.Printf("Keep it? (Y/n) ")
if w.readDefaultString("y") != "y" {
if strings.ToLower(w.readDefaultString("y")) != "y" {
fmt.Printf("New rtmp port? (default 1935)")
w.rtmpPort = w.readDefaultString("1935")
fmt.Printf("New http port? (default 8935)")
Expand Down
10 changes: 5 additions & 5 deletions cmd/livepeer_cli/wizard_stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@ import (
"text/tabwriter"

"github.com/golang/glog"
"strings"
)

func (w *wizard) stats(tips bool) {
func (w *wizard) stats(showTranscoder bool) {
// Observe how the b's and the d's, despite appearing in the
// second cell of each line, belong to different columns.
// wtr := tabwriter.NewWriter(os.Stdout, 0, 0, 1, ' ', tabwriter.AlignRight|tabwriter.Debug)
Expand All @@ -30,11 +29,12 @@ func (w *wizard) stats(tips bool) {
fmt.Fprintf(wtr, "Eth balance: \t%s\n", w.getEthBalance())
wtr.Flush()

if strings.Compare(w.getTranscoderStatus(), "False") == 0 {
if showTranscoder {
w.transcoderStats()
w.delegatorStats()
w.broadcastStats()
} else {
w.transcoderStats()
w.broadcastStats()
w.delegatorStats()
}

}
Expand Down

0 comments on commit d5842ca

Please sign in to comment.