Version parameter
This commit is contained in:
parent
ff1c848c58
commit
7724c742ad
7
main.go
7
main.go
@ -32,6 +32,7 @@ var (
|
||||
logger *slog.Logger
|
||||
flagConfigFile string
|
||||
flagDev bool
|
||||
flagVersion bool
|
||||
service *ws.Service
|
||||
logFile *os.File
|
||||
parsedTemplates map[string]*template.Template
|
||||
@ -59,6 +60,7 @@ func init() { // {{{
|
||||
cfgPath := path.Join(confDir, "smon.yaml")
|
||||
flag.StringVar(&flagConfigFile, "config", cfgPath, "Path and filename of the YAML configuration file")
|
||||
flag.BoolVar(&flagDev, "dev", false, "reload templates on each request")
|
||||
flag.BoolVar(&flagVersion, "version", false, "Display version and exit")
|
||||
flag.Parse()
|
||||
|
||||
componentFilenames, err = getComponentFilenames(viewFS)
|
||||
@ -70,6 +72,11 @@ func init() { // {{{
|
||||
} // }}}
|
||||
|
||||
func main() { // {{{
|
||||
if flagVersion {
|
||||
fmt.Println(VERSION)
|
||||
os.Exit(0)
|
||||
}
|
||||
|
||||
var err error
|
||||
|
||||
werr.Init()
|
||||
|
Loading…
Reference in New Issue
Block a user