summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'cmd')
-rw-r--r--cmd/commandfuncs.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/cmd/commandfuncs.go b/cmd/commandfuncs.go
index e3daae5..bc4c227 100644
--- a/cmd/commandfuncs.go
+++ b/cmd/commandfuncs.go
@@ -576,6 +576,10 @@ func cmdFmt(fl Flags) (int, error) {
fmt.Print(string(output))
}
+ if warning, diff := caddyfile.FormattingDifference(formatCmdConfigFile, input); diff {
+ return caddy.ExitCodeFailedStartup, fmt.Errorf("%s:%d: Caddyfile input is not formatted", warning.File, warning.Line)
+ }
+
return caddy.ExitCodeSuccess, nil
}