mirror of
https://github.com/kopia/kopia.git
synced 2026-05-09 15:23:02 -04:00
chore(cli): handle potential conversion overflow when setting progress default (#5271)
This commit is contained in:
@@ -31,9 +31,10 @@ type progressFlags struct {
|
||||
}
|
||||
|
||||
func (p *progressFlags) setup(svc appServices, app *kingpin.Application) {
|
||||
progressDefault := "true"
|
||||
if !term.IsTerminal(int(os.Stdout.Fd())) {
|
||||
progressDefault = "false"
|
||||
progressDefault := "false"
|
||||
|
||||
if fd, err := intFd(os.Stdout); err == nil && term.IsTerminal(fd) {
|
||||
progressDefault = "true"
|
||||
}
|
||||
|
||||
app.Flag("progress", "Enable progress output").Default(progressDefault).BoolVar(&p.enableProgress)
|
||||
|
||||
Reference in New Issue
Block a user