We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c9c90df commit 7219aa8Copy full SHA for 7219aa8
main.go
@@ -76,8 +76,14 @@ func main() {
76
if parentPreRun != nil {
77
parentPreRun(cmd, args)
78
}
79
- for _, warning := range configFileLoadingWarnings {
80
- feedback.Warning(warning)
+
+ // In Text mode print the warnings about the configuration file
81
+ // only if we are inside the "config ..." command. In JSON mode always
82
+ // output the warning.
83
+ if feedback.GetFormat() != feedback.Text || (cmd.HasParent() && cmd.Parent().Name() == "config") {
84
+ for _, warning := range configFileLoadingWarnings {
85
+ feedback.Warning(fmt.Sprintf("%s: %s", i18n.Tr("Invalid value in configuration"), warning))
86
+ }
87
88
89
0 commit comments