Add --panicOnWarning flag

Fixes #9357
Fixes #9359
This commit is contained in:
Bjørn Erik Pedersen 2022-01-06 10:22:19 +01:00
parent 85c5b89593
commit c8b5ab75b7
4 changed files with 22 additions and 6 deletions

View file

@ -68,7 +68,7 @@ func newSystemErrorF(format string, a ...interface{}) commandError {
// Catch some of the obvious user errors from Cobra.
// We don't want to show the usage message for every error.
// The below may be to generic. Time will show.
var userErrorRegexp = regexp.MustCompile("argument|flag|shorthand")
var userErrorRegexp = regexp.MustCompile("unknown flag")
func isUserError(err error) bool {
if cErr, ok := err.(commandError); ok && cErr.isUserError() {