fix(climc): 避免climc交互模式下--help自动退出 (#18338)

This commit is contained in:
屈轩
2023-10-17 20:58:36 -05:00
committed by GitHub
parent 3961c28168
commit c8a60bec2e
4 changed files with 6 additions and 5 deletions
+1 -1
View File
@@ -91,7 +91,7 @@ require (
yunion.io/x/pkg v1.0.1-0.20231012131524-8a175238485b
yunion.io/x/s3cli v0.0.0-20190917004522-13ac36d8687e
yunion.io/x/sqlchemy v1.1.2-0.20231011114043-0d203453d3e2
yunion.io/x/structarg v0.0.0-20220312084958-9c6c79c7d1c6
yunion.io/x/structarg v0.0.0-20231017124457-df4d5009457c
)
require (
+2 -2
View File
@@ -1195,5 +1195,5 @@ yunion.io/x/s3cli v0.0.0-20190917004522-13ac36d8687e h1:v+EzIadodSwkdZ/7bremd7J8
yunion.io/x/s3cli v0.0.0-20190917004522-13ac36d8687e/go.mod h1:0iFKpOs1y4lbCxeOmq3Xx/0AcQoewVPwj62eRluioEo=
yunion.io/x/sqlchemy v1.1.2-0.20231011114043-0d203453d3e2 h1:DB6wG9VXsnJGaABcfN89wRjRPCCCuJSsd8xob48BD8Q=
yunion.io/x/sqlchemy v1.1.2-0.20231011114043-0d203453d3e2/go.mod h1:uuPVZEyEq3sWd5vf9VjGSy6lZzof22X87OEHw9sddJQ=
yunion.io/x/structarg v0.0.0-20220312084958-9c6c79c7d1c6 h1:WuWXhY3DvhdRTzWCJ/kwt3Ss6KIq7+KqJwb+esvNGwU=
yunion.io/x/structarg v0.0.0-20220312084958-9c6c79c7d1c6/go.mod h1:EP6NSv2C0zzqBDTKumv8hPWLb3XvgMZDHQRfyuOrQng=
yunion.io/x/structarg v0.0.0-20231017124457-df4d5009457c h1:QuLab2kSRECZRxo4Lo2KcYn6XjQFDGaZ1+x0pYDVVwQ=
yunion.io/x/structarg v0.0.0-20231017124457-df4d5009457c/go.mod h1:EP6NSv2C0zzqBDTKumv8hPWLb3XvgMZDHQRfyuOrQng=
+1 -1
View File
@@ -1593,6 +1593,6 @@ yunion.io/x/sqlchemy/backends
yunion.io/x/sqlchemy/backends/clickhouse
yunion.io/x/sqlchemy/backends/mysql
yunion.io/x/sqlchemy/backends/sqlite
# yunion.io/x/structarg v0.0.0-20220312084958-9c6c79c7d1c6
# yunion.io/x/structarg v0.0.0-20231017124457-df4d5009457c
## explicit; go 1.12
yunion.io/x/structarg
+2 -1
View File
@@ -1008,6 +1008,7 @@ func (this *ArgumentParser) reset() {
for _, arg := range this.optArgs {
arg.Reset()
}
this.help = false
}
func (this *ArgumentParser) ParseArgs(args []string, ignore_unknown bool) error {
@@ -1026,7 +1027,7 @@ func (this *ArgumentParser) ParseArgs2(args []string, ignore_unknown bool, setDe
if argStr == "--help" {
// shortcut to show help
fmt.Println(this.HelpString())
os.Exit(1)
this.help = true
continue
}
if strings.HasPrefix(argStr, "-") {