From bf9cf2bf960b30c5bfb75d3d7b5e6b2fa4e644e4 Mon Sep 17 00:00:00 2001 From: maddalax Date: Fri, 1 Nov 2024 07:23:18 -0500 Subject: [PATCH] add version --- cli/htmgo/runner.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cli/htmgo/runner.go b/cli/htmgo/runner.go index 0cfd586..d3c7921 100644 --- a/cli/htmgo/runner.go +++ b/cli/htmgo/runner.go @@ -19,11 +19,13 @@ import ( "sync" ) +const version = "1.0.3" + func main() { needsSignals := true commandMap := make(map[string]*flag.FlagSet) - commands := []string{"template", "run", "watch", "build", "setup", "css", "schema", "generate", "format"} + commands := []string{"template", "run", "watch", "build", "setup", "css", "schema", "generate", "format", "version"} for _, command := range commands { commandMap[command] = flag.NewFlagSet(command, flag.ExitOnError) @@ -100,6 +102,10 @@ func main() { }() startWatcher(reloader.OnFileChange) } else { + if taskName == "version" { + fmt.Printf("htmgo cli version %s\n", version) + os.Exit(0) + } if taskName == "format" { if len(os.Args) < 3 { fmt.Println(fmt.Sprintf("Usage: htmgo format "))