aboutsummaryrefslogtreecommitdiffhomepage
path: root/cmd
diff options
context:
space:
mode:
authorEmily Lange <[email protected]>2023-02-17 00:34:12 +0100
committerGitHub <[email protected]>2023-02-16 16:34:12 -0700
commitbf54892a73373637901c13e018b20cfac15878b4 (patch)
treee9cf0bed1624253c28bb3752f86b043198c09995 /cmd
parent5ded580444e9258cb35a9c94192d3c1d63e7b74f (diff)
downloadcaddy-bf54892a73373637901c13e018b20cfac15878b4.tar.gz
caddy-bf54892a73373637901c13e018b20cfac15878b4.zip
cmd: make `caddy fmt` hints more clear (#5378)
Diffstat (limited to 'cmd')
-rw-r--r--cmd/commandfuncs.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/cmd/commandfuncs.go b/cmd/commandfuncs.go
index 09accd0d3..62afae2bb 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