add version
This commit is contained in:
parent
2346708ab1
commit
bf9cf2bf96
1 changed files with 7 additions and 1 deletions
|
|
@ -19,11 +19,13 @@ import (
|
||||||
"sync"
|
"sync"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const version = "1.0.3"
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
needsSignals := true
|
needsSignals := true
|
||||||
|
|
||||||
commandMap := make(map[string]*flag.FlagSet)
|
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 {
|
for _, command := range commands {
|
||||||
commandMap[command] = flag.NewFlagSet(command, flag.ExitOnError)
|
commandMap[command] = flag.NewFlagSet(command, flag.ExitOnError)
|
||||||
|
|
@ -100,6 +102,10 @@ func main() {
|
||||||
}()
|
}()
|
||||||
startWatcher(reloader.OnFileChange)
|
startWatcher(reloader.OnFileChange)
|
||||||
} else {
|
} else {
|
||||||
|
if taskName == "version" {
|
||||||
|
fmt.Printf("htmgo cli version %s\n", version)
|
||||||
|
os.Exit(0)
|
||||||
|
}
|
||||||
if taskName == "format" {
|
if taskName == "format" {
|
||||||
if len(os.Args) < 3 {
|
if len(os.Args) < 3 {
|
||||||
fmt.Println(fmt.Sprintf("Usage: htmgo format <file>"))
|
fmt.Println(fmt.Sprintf("Usage: htmgo format <file>"))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue