Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Set up go
uses: actions/setup-go@v3
with:
go-version: 1.20.14
go-version: 1.19.2

- name: Build
run: bash hack/github-release.sh
Expand Down
12 changes: 10 additions & 2 deletions cmd/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"fmt"
"io"
"io/ioutil"
"slices"
"strconv"
"strings"
"sync"
Expand Down Expand Up @@ -50,7 +49,7 @@ func NewCmdAPI(out io.Writer) *cobra.Command {
Short: "Call API",
Long: "Call API",
Run: func(c *cobra.Command, args []string) {
if slices.Contains(args, "--help") {
if containHelp(args) {
fmt.Fprintln(out, HelpInfo)
return
}
Expand Down Expand Up @@ -251,3 +250,12 @@ func genericInvokeRepeatWrapper(repeatsConfig *RepeatsConfig, params map[string]
refresh.Do(fmt.Sprintf("finally, total:%d, success:%d, fail:%d", repeats, success.Load(), repeats-int(success.Load())))
return nil
}

func containHelp(args []string) bool {
for _, arg := range args {
if arg == "--help" {
return true
}
}
return false
}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/ucloud/ucloud-cli

go 1.20
go 1.19

require (
github.com/fatih/color v1.13.0
Expand Down