summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'cmd')
-rw-r--r--cmd/main.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/cmd/main.go b/cmd/main.go
index e92e71f..2dfb867 100644
--- a/cmd/main.go
+++ b/cmd/main.go
@@ -123,7 +123,11 @@ func loadConfig(configFile, adapterName string) ([]byte, string, error) {
var cfgAdapter caddyconfig.Adapter
var err error
if configFile != "" {
- config, err = ioutil.ReadFile(configFile)
+ if configFile == "-" {
+ config, err = ioutil.ReadAll(os.Stdin)
+ } else {
+ config, err = ioutil.ReadFile(configFile)
+ }
if err != nil {
return nil, "", fmt.Errorf("reading config file: %v", err)
}