summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--caddyconfig/caddyfile/adapter.go2
-rw-r--r--cmd/commandfuncs.go5
2 files changed, 5 insertions, 2 deletions
diff --git a/caddyconfig/caddyfile/adapter.go b/caddyconfig/caddyfile/adapter.go
index b924325..d6ef602 100644
--- a/caddyconfig/caddyfile/adapter.go
+++ b/caddyconfig/caddyfile/adapter.go
@@ -88,7 +88,7 @@ func FormattingDifference(filename string, body []byte) (caddyconfig.Warning, bo
return caddyconfig.Warning{
File: filename,
Line: line,
- Message: "Caddyfile input is not formatted; run the 'caddy fmt' command to fix inconsistencies",
+ Message: "Caddyfile input is not formatted; run 'caddy fmt --overwrite' to fix inconsistencies",
}, true
}
diff --git a/cmd/commandfuncs.go b/cmd/commandfuncs.go
index 09accd0..62afae2 100644
--- a/cmd/commandfuncs.go
+++ b/cmd/commandfuncs.go
@@ -589,7 +589,10 @@ func cmdFmt(fl Flags) (int, error) {
}
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.ExitCodeFailedStartup, fmt.Errorf(`%s:%d: Caddyfile input is not formatted; Tip: use '--overwrite' to update your Caddyfile in-place instead of previewing it. Consult '--help' for more options`,
+ warning.File,
+ warning.Line,
+ )
}
return caddy.ExitCodeSuccess, nil