mirror of
https://github.com/caddyserver/caddy.git
synced 2025-01-13 22:51:08 -05:00
Add flag to list directives.
This commit is contained in:
parent
35e4c1a7bf
commit
3b6c387b84
1 changed files with 14 additions and 5 deletions
9
main.go
9
main.go
|
@ -14,6 +14,7 @@ import (
|
||||||
|
|
||||||
"github.com/mholt/caddy/caddy"
|
"github.com/mholt/caddy/caddy"
|
||||||
"github.com/mholt/caddy/caddy/https"
|
"github.com/mholt/caddy/caddy/https"
|
||||||
|
"github.com/mholt/caddy/caddy/parse"
|
||||||
"github.com/xenolf/lego/acme"
|
"github.com/xenolf/lego/acme"
|
||||||
"gopkg.in/natefinch/lumberjack.v2"
|
"gopkg.in/natefinch/lumberjack.v2"
|
||||||
)
|
)
|
||||||
|
@ -36,6 +37,7 @@ func init() {
|
||||||
flag.StringVar(&revoke, "revoke", "", "Hostname for which to revoke the certificate")
|
flag.StringVar(&revoke, "revoke", "", "Hostname for which to revoke the certificate")
|
||||||
flag.StringVar(&caddy.Root, "root", caddy.DefaultRoot, "Root path to default site")
|
flag.StringVar(&caddy.Root, "root", caddy.DefaultRoot, "Root path to default site")
|
||||||
flag.BoolVar(&version, "version", false, "Show version")
|
flag.BoolVar(&version, "version", false, "Show version")
|
||||||
|
flag.BoolVar(&directives, "directives", false, "List supported directives")
|
||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
@ -77,6 +79,12 @@ func main() {
|
||||||
}
|
}
|
||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
}
|
}
|
||||||
|
if directives {
|
||||||
|
for d := range parse.ValidDirectives {
|
||||||
|
fmt.Println(d)
|
||||||
|
}
|
||||||
|
os.Exit(0)
|
||||||
|
}
|
||||||
|
|
||||||
// Set CPU cap
|
// Set CPU cap
|
||||||
err := setCPU(cpu)
|
err := setCPU(cpu)
|
||||||
|
@ -217,6 +225,7 @@ var (
|
||||||
logfile string
|
logfile string
|
||||||
revoke string
|
revoke string
|
||||||
version bool
|
version bool
|
||||||
|
directives bool
|
||||||
)
|
)
|
||||||
|
|
||||||
// Build information obtained with the help of -ldflags
|
// Build information obtained with the help of -ldflags
|
||||||
|
|
Loading…
Reference in a new issue