Fix mixup between stdout and stderr in CLI (#11529)

Этот коммит содержится в:
Claudio Costa
2019-07-10 14:36:49 +02:00
коммит произвёл Jesús Espino
родитель 15be0c6c79
Коммит 70fd0e0d6f
4 изменённых файлов: 5 добавлений и 5 удалений

Просмотреть файл

@@ -456,7 +456,7 @@ func listChannelsCmdF(command *cobra.Command, args []string) error {
if channel.Type == model.CHANNEL_PRIVATE { if channel.Type == model.CHANNEL_PRIVATE {
output += " (private)" output += " (private)"
} }
CommandPrintErrorln(output) CommandPrettyPrintln(output)
} }
} }
} }

Просмотреть файл

@@ -198,7 +198,7 @@ func bulkExportCmdF(command *cobra.Command, args []string) error {
// args[0] points to the filename/filepath passed with export bulk command // args[0] points to the filename/filepath passed with export bulk command
if err := a.BulkExport(fileWriter, args[0], pathToEmojiDir, dirNameToExportEmoji); err != nil { if err := a.BulkExport(fileWriter, args[0], pathToEmojiDir, dirNameToExportEmoji); err != nil {
CommandPrettyPrintln(err.Error()) CommandPrintErrorln(err.Error())
return err return err
} }

Просмотреть файл

@@ -138,9 +138,9 @@ func bulkImportCmdF(command *cobra.Command, args []string) error {
CommandPrettyPrintln("") CommandPrettyPrintln("")
if err, lineNumber := a.BulkImport(fileReader, !apply, workers); err != nil { if err, lineNumber := a.BulkImport(fileReader, !apply, workers); err != nil {
CommandPrettyPrintln(err.Error()) CommandPrintErrorln(err.Error())
if lineNumber != 0 { if lineNumber != 0 {
CommandPrettyPrintln(fmt.Sprintf("Error occurred on data file line %v", lineNumber)) CommandPrintErrorln(fmt.Sprintf("Error occurred on data file line %v", lineNumber))
} }
return err return err
} }

Просмотреть файл

@@ -17,5 +17,5 @@ func CommandPrintErrorln(a ...interface{}) (int, error) {
} }
func CommandPrettyPrintln(a ...interface{}) (int, error) { func CommandPrettyPrintln(a ...interface{}) (int, error) {
return fmt.Fprintln(os.Stderr, a...) return fmt.Fprintln(os.Stdout, a...)
} }