增加-h参数,优化参数处理

This commit is contained in:
fumiama
2021-10-11 13:15:38 +08:00
parent c46748524a
commit 119730bada
2 changed files with 23 additions and 20 deletions

View File

@@ -4,10 +4,8 @@ package web
import "flag"
func init() {
var en bool
// 解析命令行参数,输入 `-g` 即可启用 gui
flag.BoolVar(&en, "g", false, "Enable web gui.")
if en {
if *flag.Bool("g", false, "Enable web gui.") {
initGui()
}
}