summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'cmd')
-rw-r--r--cmd/main.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/cmd/main.go b/cmd/main.go
index 564ef9f..d8e5f7b 100644
--- a/cmd/main.go
+++ b/cmd/main.go
@@ -134,6 +134,13 @@ func loadConfig(configFile, adapterName string) ([]byte, error) {
}
}
+ // as a special case, if a config file called "Caddyfile" was
+ // specified, and no adapter is specified, assume caddyfile adapter
+ // for convenience
+ if filepath.Base(configFile) == "Caddyfile" && adapterName == "" {
+ adapterName = "caddyfile"
+ }
+
// load config adapter
if adapterName != "" {
cfgAdapter = caddyconfig.GetAdapter(adapterName)