Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions cmd/fleetctl/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"os"
"strings"
"time"
"io/ioutil"

"github.com/briandowns/spinner"
"github.com/urfave/cli"
Expand Down Expand Up @@ -124,9 +125,10 @@ func queryCommand() cli.Command {
// https://godoc.org/github.com/briandowns/spinner#pkg-variables
s := spinner.New(spinner.CharSets[24], 200*time.Millisecond)
s.Writer = os.Stderr
if !flQuiet {
s.Start()
if flQuiet {
s.Writer = ioutil.Discard
}
s.Start()

var timeoutChan <-chan time.Time
if flTimeout > 0 {
Expand Down Expand Up @@ -176,9 +178,7 @@ func queryCommand() cli.Command {
}

msg := fmt.Sprintf(" %.f%% responded (%.f%% online) | %d/%d targeted hosts (%d/%d online)", percentTotal, percentOnline, responded, total, responded, online)
if !flQuiet {
s.Suffix = msg
}
s.Suffix = msg
if total == responded && status != nil {
s.Stop()
if !flQuiet {
Expand Down