diff --git a/main.go b/main.go index 5a635fe..e191dd5 100644 --- a/main.go +++ b/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()