mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-30 23:53:48 +03:00
Add -version flag
This commit is contained in:
parent
a5f20829cb
commit
2ce5102473
1 changed files with 11 additions and 4 deletions
15
main.go
15
main.go
|
@ -20,10 +20,11 @@ import (
|
|||
)
|
||||
|
||||
var (
|
||||
conf string
|
||||
http2 bool // TODO: temporary flag until http2 is standard
|
||||
quiet bool
|
||||
cpu string
|
||||
conf string
|
||||
http2 bool // TODO: temporary flag until http2 is standard
|
||||
quiet bool
|
||||
cpu string
|
||||
version bool
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
@ -34,6 +35,7 @@ func init() {
|
|||
flag.StringVar(&config.Root, "root", config.DefaultRoot, "Root path to default site")
|
||||
flag.StringVar(&config.Host, "host", config.DefaultHost, "Default host")
|
||||
flag.StringVar(&config.Port, "port", config.DefaultPort, "Default port")
|
||||
flag.BoolVar(&version, "version", false, "Show version")
|
||||
|
||||
config.AppName = "Caddy"
|
||||
config.AppVersion = "0.6.0"
|
||||
|
@ -42,6 +44,11 @@ func init() {
|
|||
func main() {
|
||||
flag.Parse()
|
||||
|
||||
if version {
|
||||
fmt.Printf("%s %s\n", config.AppName, config.AppVersion)
|
||||
os.Exit(0)
|
||||
}
|
||||
|
||||
var wg sync.WaitGroup
|
||||
|
||||
// Set CPU cap
|
||||
|
|
Loading…
Reference in a new issue