flags.go 457 B

123456789101112131415161718
  1. package main
  2. import (
  3. "flag"
  4. "github.com/mitchellh/go-homedir"
  5. "path"
  6. )
  7. var (
  8. HOME_DIR, _ = homedir.Dir()
  9. HTTPS_ADDR = flag.String("https", ":443", "the https address to listen on")
  10. STORAGE = flag.String("storage", path.Join(HOME_DIR, "httpsify/certs"), "the ssl certs storage directory")
  11. HOSTS_FILE = flag.String("hosts", path.Join(HOME_DIR, "httpsify/hosts.json"), "the sites configurations filename")
  12. )
  13. func InitFlags() {
  14. flag.Parse()
  15. }