fix: Get devices (and most other successful commands) should output to Stdout, not Stderr (#360)

Closes #356
This commit is contained in:
thepriefy
2017-12-14 10:47:03 +07:00
committed by Victor Vrantchan
parent 6e561224d0
commit ced71b4e38
8 changed files with 8 additions and 8 deletions

View File

@@ -123,7 +123,7 @@ func (cmd *getCommand) getDevices(args []string) error {
if err := flagset.Parse(args); err != nil {
return err
}
w := tabwriter.NewWriter(os.Stderr, 0, 4, 2, ' ', 0)
w := tabwriter.NewWriter(os.Stdout, 0, 4, 2, ' ', 0)
out := &devicesTableOutput{w}
out.BasicHeader()
defer out.BasicFooter()

View File

@@ -50,7 +50,7 @@ func (cmd *getCommand) getApps(args []string) error {
if err != nil {
return err
}
w := tabwriter.NewWriter(os.Stderr, 0, 4, 2, ' ', 0)
w := tabwriter.NewWriter(os.Stdout, 0, 4, 2, ' ', 0)
out := appsTableOutput{w}
out.BasicHeader()
defer out.BasicFooter()

View File

@@ -24,7 +24,7 @@ func (cmd *getCommand) getDEPAccount(args []string) error {
if err := flagset.Parse(args); err != nil {
return err
}
w := tabwriter.NewWriter(os.Stderr, 0, 4, 2, ' ', 0)
w := tabwriter.NewWriter(os.Stdout, 0, 4, 2, ' ', 0)
out := &depaccountTableOutput{w}
out.BasicHeader()
defer out.BasicFooter()

View File

@@ -31,7 +31,7 @@ func (cmd *getCommand) getDEPDevices(args []string) error {
flagset.Usage()
return errors.New("bad input: must provide a comma separated list of DEP serials")
}
w := tabwriter.NewWriter(os.Stderr, 0, 4, 2, ' ', 0)
w := tabwriter.NewWriter(os.Stdout, 0, 4, 2, ' ', 0)
out := &depDevicesTableOutput{w}
out.BasicHeader()
defer out.BasicFooter()

View File

@@ -50,7 +50,7 @@ func (cmd *getCommand) getDEPProfiles(args []string) error {
}
if *flProfilePath == "" {
w := tabwriter.NewWriter(os.Stderr, 0, 4, 2, ' ', 0)
w := tabwriter.NewWriter(os.Stdout, 0, 4, 2, ' ', 0)
out := &depProfilesTableOutput{w}
out.BasicHeader()
defer out.BasicFooter()

View File

@@ -28,7 +28,7 @@ func (cmd *getCommand) getUsers(args []string) error {
return err
}
w := tabwriter.NewWriter(os.Stderr, 0, 4, 2, ' ', 0)
w := tabwriter.NewWriter(os.Stdout, 0, 4, 2, ' ', 0)
out := &usersTableOutput{w}
out.BasicHeader()
defer out.BasicFooter()

View File

@@ -73,7 +73,7 @@ func usageFor(fs *flag.FlagSet, short string) func() {
fmt.Fprintf(os.Stderr, " %s\n", short)
fmt.Fprintf(os.Stderr, "\n")
fmt.Fprintf(os.Stderr, "FLAGS\n")
w := tabwriter.NewWriter(os.Stderr, 0, 2, 2, ' ', 0)
w := tabwriter.NewWriter(os.Stdout, 0, 2, 2, ' ', 0)
fs.VisitAll(func(f *flag.Flag) {
fmt.Fprintf(w, "\t-%s %s\t%s\n", f.Name, f.DefValue, f.Usage)
})

View File

@@ -59,7 +59,7 @@ func usageFor(fs *flag.FlagSet, short string) func() {
fmt.Fprintf(os.Stderr, " %s\n", short)
fmt.Fprintf(os.Stderr, "\n")
fmt.Fprintf(os.Stderr, "FLAGS\n")
w := tabwriter.NewWriter(os.Stderr, 0, 2, 2, ' ', 0)
w := tabwriter.NewWriter(os.Stdout, 0, 2, 2, ' ', 0)
fs.VisitAll(func(f *flag.Flag) {
fmt.Fprintf(w, "\t-%s %s\t%s\n", f.Name, f.DefValue, f.Usage)
})