Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
spiritLHLS committed Jul 1, 2024
1 parent d2e8e4c commit f14dc07
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,19 @@ import (
)

func main() {
var showVersion bool
var showVersion, help bool
var language string
basicsFlag := flag.NewFlagSet("basics", flag.ContinueOnError)
basicsFlag.BoolVar(&showVersion, "v", false, "show version")
basicsFlag.BoolVar(&help, "h", false, "Show help information")
basicsFlag.BoolVar(&showVersion, "v", false, "Show version")
basicsFlag.BoolVar(&model.EnableLoger, "e", false, "Enable logging")
basicsFlag.StringVar(&language, "l", "", "Language parameter (en or zh)")
basicsFlag.StringVar(&language, "l", "", "Set language (en or zh)")
basicsFlag.Parse(os.Args[1:])
if help {
fmt.Printf("Usage: %s [options]\n", os.Args[0])
basicsFlag.PrintDefaults()
return
}
if showVersion {
fmt.Println(model.BasicsVersion)
return
Expand Down

0 comments on commit f14dc07

Please sign in to comment.