Commit 3b6c387b authored by Abiola Ibrahim's avatar Abiola Ibrahim

Add flag to list directives.

parent 35e4c1a7
......@@ -14,6 +14,7 @@ import (
"github.com/mholt/caddy/caddy"
"github.com/mholt/caddy/caddy/https"
"github.com/mholt/caddy/caddy/parse"
"github.com/xenolf/lego/acme"
"gopkg.in/natefinch/lumberjack.v2"
)
......@@ -36,6 +37,7 @@ func init() {
flag.StringVar(&revoke, "revoke", "", "Hostname for which to revoke the certificate")
flag.StringVar(&caddy.Root, "root", caddy.DefaultRoot, "Root path to default site")
flag.BoolVar(&version, "version", false, "Show version")
flag.BoolVar(&directives, "directives", false, "List supported directives")
}
func main() {
......@@ -77,6 +79,12 @@ func main() {
}
os.Exit(0)
}
if directives {
for d := range parse.ValidDirectives {
fmt.Println(d)
}
os.Exit(0)
}
// Set CPU cap
err := setCPU(cpu)
......@@ -212,11 +220,12 @@ const appName = "Caddy"
// Flags that control program flow or startup
var (
conf string
cpu string
logfile string
revoke string
version bool
conf string
cpu string
logfile string
revoke string
version bool
directives bool
)
// Build information obtained with the help of -ldflags
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment