non-tty progress write to stdout

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
Nicolas De Loof 2021-02-16 17:36:07 +01:00
parent a2d335271a
commit 057f23ed75
No known key found for this signature in database
GPG Key ID: 9858809D6F8F6E7E
2 changed files with 6 additions and 1 deletions

View File

@ -37,7 +37,7 @@ func (p *plainWriter) Start(ctx context.Context) error {
}
func (p *plainWriter) Event(e Event) {
fmt.Println(e.ID, e.Text, e.StatusText)
fmt.Fprintln(p.out, e.ID, e.Text, e.StatusText)
}
func (p *plainWriter) Stop() {

View File

@ -89,6 +89,11 @@ func runConvert(ctx context.Context, opts convertOptions, services []string) err
if err != nil {
return err
}
if opts.quiet {
return nil
}
var out io.Writer = os.Stdout
if opts.Output != "" {
file, err := os.Create(opts.Output)