Skip to content

Commit

Permalink
add version params
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangnew committed Oct 16, 2023
1 parent 4619142 commit a97d2df
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ type AgentCliParam struct {
ClientSecret string // 客户端密钥
ReportDelay int // 报告间隔
TLS bool // 是否使用TLS加密传输至服务端
Version bool // 当前版本号
}

var (
Expand Down Expand Up @@ -157,8 +158,14 @@ func main() {
flag.BoolVar(&agentCliParam.DisableAutoUpdate, "disable-auto-update", false, "禁用自动升级")
flag.BoolVar(&agentCliParam.DisableForceUpdate, "disable-force-update", false, "禁用强制升级")
flag.BoolVar(&agentCliParam.TLS, "tls", false, "启用SSL/TLS加密")
flag.BoolVarP(&agentCliParam.Version, "version", "v", false, "查看当前版本号")
flag.Parse()

if agentCliParam.Version {
fmt.Println(version)
return
}

if isEditAgentConfig {
editAgentConfig()
return
Expand Down

0 comments on commit a97d2df

Please sign in to comment.