From 97388b3504d3e5224291e36bbb25c3d353bcfaf4 Mon Sep 17 00:00:00 2001 From: Michael Eischer Date: Wed, 30 Dec 2020 21:24:18 +0100 Subject: [PATCH] Properly check that --quiet and --verbose are not combined If --verbose is specified once, then globalOptions.Verbose == 1. Previously --quiet --verbose would silently ignore the --verbose flag. --- cmd/restic/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/restic/main.go b/cmd/restic/main.go index 0f09b6746..0479124b1 100644 --- a/cmd/restic/main.go +++ b/cmd/restic/main.go @@ -32,7 +32,7 @@ directories in an encrypted repository stored on different backends. PersistentPreRunE: func(c *cobra.Command, args []string) error { // set verbosity, default is one globalOptions.verbosity = 1 - if globalOptions.Quiet && (globalOptions.Verbose > 1) { + if globalOptions.Quiet && globalOptions.Verbose > 0 { return errors.Fatal("--quiet and --verbose cannot be specified at the same time") }