Skip to content

Commit db0cf92

Browse files
allmightyspiffGitHub Enterprise
authored andcommitted
Merge pull request #832 from SoftLayer/issues831
Update firmware improvements, updated gomega version
2 parents 5137e09 + 7b9a416 commit db0cf92

605 files changed

Lines changed: 761 additions & 807 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

cliChecker/main.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import (
77
sl_plugin "github.ibm.com/SoftLayer/softlayer-cli/plugin"
88
)
99

10-
1110
func main() {
1211
fmt.Printf("IBMCLOUD SL Command Directory\n")
1312

@@ -33,4 +32,4 @@ func main() {
3332
fmt.Printf("\tUsage: %s\n", slCmd.Usage)
3433
fmt.Printf("==============================================================\n")
3534
}
36-
}
35+
}

docs/main.go

Lines changed: 28 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
package main
22

33
import (
4+
"encoding/json"
45
"fmt"
56
"os"
6-
"strings"
7-
"encoding/json"
87
"regexp"
8+
"strings"
99

1010
"text/template"
1111
// "sort"
@@ -17,7 +17,7 @@ import (
1717

1818
var fileName string
1919
var rootCmd = &cobra.Command{
20-
Use: "doc-gen",
20+
Use: "doc-gen",
2121
Short: "Generate the documentation for the sl plugin",
2222
RunE: func(Cmd *cobra.Command, args []string) error {
2323
CliDocs()
@@ -39,33 +39,31 @@ func checkError(err error) {
3939

4040
// For top level commands, like `sl account` or `sl hardware`
4141
type SlCmdGroup struct {
42-
Name string
42+
Name string
4343
CommandShortLink string
44-
Commands []SlCmdDoc
45-
Help string
44+
Commands []SlCmdDoc
45+
Help string
4646
}
4747

4848
// For specific commands
4949
type SlCmdDoc struct {
50-
Name string
50+
Name string
5151
CommandShortLink string
52-
Use string
53-
Flags []SlCmdFlag
54-
Help string
55-
LongHelp string
56-
Backtick string
57-
CommandPath string
52+
Use string
53+
Flags []SlCmdFlag
54+
Help string
55+
LongHelp string
56+
Backtick string
57+
CommandPath string
5858
}
5959

6060
// For a commands flags
6161
type SlCmdFlag struct {
62-
Name string
63-
Help string
62+
Name string
63+
Help string
6464
Default string
6565
}
6666

67-
68-
6967
// This function builds the documentation for IBMCLOUD docs
7068
func CliDocs() {
7169
// fmt.Printf("IBMCLOUD SL Command Directory\n")
@@ -75,11 +73,10 @@ func CliDocs() {
7573
shortName := strings.ReplaceAll(iCmd.Name(), " ", "_")
7674
shortName = strings.ReplaceAll(iCmd.Name(), "-", "_")
7775
thisCmdGroup := SlCmdGroup{
78-
Name: iCmd.Name(),
76+
Name: iCmd.Name(),
7977
CommandShortLink: fmt.Sprintf("sl_%v", shortName),
80-
Commands: nil,
81-
Help: iCmd.Short,
82-
78+
Commands: nil,
79+
Help: iCmd.Short,
8380
}
8481
if len(iCmd.Commands()) > 0 {
8582
thisCmdGroup.Commands = buildSlCmdDoc(iCmd)
@@ -93,7 +90,7 @@ func CliDocs() {
9390
jOut, err := json.MarshalIndent(CmdGroups, "", " ")
9491
checkError(err)
9592
err = os.WriteFile("sl.json", jOut, 0755) //#nosec G306 -- This is a false positive
96-
checkError(err)
93+
checkError(err)
9794
// fmt.Println(string(jOut))
9895
}
9996

@@ -172,14 +169,14 @@ func cobraToSl(iCmd *cobra.Command, tlcmd string) SlCmdDoc {
172169
shortName = strings.ReplaceAll(shortName, "-", "_")
173170
longHelp := getLongHelp(iCmd.Long)
174171
thisDoc := SlCmdDoc{
175-
Name: iCmd.Name(),
172+
Name: iCmd.Name(),
176173
CommandShortLink: shortName,
177-
CommandPath: iCmd.CommandPath(),
178-
Use: iCmd.UseLine(),
179-
Flags: nil,
180-
Help: iCmd.Short,
181-
LongHelp: longHelp,
182-
Backtick: "```",
174+
CommandPath: iCmd.CommandPath(),
175+
Use: iCmd.UseLine(),
176+
Flags: nil,
177+
Help: iCmd.Short,
178+
LongHelp: longHelp,
179+
Backtick: "```",
183180
}
184181
thisDoc.Flags = buildSlCmdFlag(iCmd)
185182

@@ -196,8 +193,8 @@ func buildSlCmdFlag(topCommand *cobra.Command) []SlCmdFlag {
196193
flagName = fmt.Sprintf("%s, %s", pflag.Shorthand, flagName)
197194
}
198195
thisFlag := SlCmdFlag{
199-
Name:flagName,
200-
Help: getFlagHelp(pflag.Usage),
196+
Name: flagName,
197+
Help: getFlagHelp(pflag.Usage),
201198
Default: pflag.DefValue,
202199
}
203200
flags = append(flags, thisFlag)

go.mod

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,42 +12,40 @@ require (
1212
github.com/Xuanwo/go-locale v1.1.0
1313
github.com/miekg/dns v1.1.50
1414
github.com/nicksnyder/go-i18n v1.10.1
15-
github.com/onsi/ginkgo v1.16.2
16-
github.com/onsi/gomega v1.29.0
15+
github.com/onsi/ginkgo/v2 v2.15.0
16+
github.com/onsi/gomega v1.31.1
1717
github.com/softlayer/softlayer-go v1.1.2
18-
github.com/spf13/cobra v1.5.0
18+
github.com/spf13/cobra v1.8.0
1919
github.com/spf13/pflag v1.0.5
2020
github.com/stretchr/testify v1.7.0
2121
golang.org/x/text v0.14.0
2222
)
2323

2424
require (
25-
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
2625
github.com/davecgh/go-spew v1.1.1 // indirect
2726
github.com/fatih/color v1.10.0 // indirect
2827
github.com/fatih/structs v1.1.0 // indirect
29-
github.com/fsnotify/fsnotify v1.4.9 // indirect
28+
github.com/go-logr/logr v1.3.0 // indirect
29+
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
3030
github.com/gofrs/flock v0.8.1 // indirect
3131
github.com/google/go-cmp v0.6.0 // indirect
32-
github.com/inconshreveable/mousetrap v1.0.0 // indirect
32+
github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38 // indirect
33+
github.com/inconshreveable/mousetrap v1.1.0 // indirect
3334
github.com/mattn/go-colorable v0.1.8 // indirect
3435
github.com/mattn/go-isatty v0.0.12 // indirect
3536
github.com/mattn/go-runewidth v0.0.12 // indirect
3637
github.com/nicksnyder/go-i18n/v2 v2.2.0 // indirect
37-
github.com/nxadm/tail v1.4.8 // indirect
3838
github.com/pelletier/go-toml v1.2.0 // indirect
3939
github.com/pmezard/go-difflib v1.0.0 // indirect
4040
github.com/rivo/uniseg v0.1.0 // indirect
41-
github.com/russross/blackfriday/v2 v2.1.0 // indirect
4241
github.com/softlayer/xmlrpc v0.0.0-20200409220501-5f089df7cb7e // indirect
4342
golang.org/x/crypto v0.17.0 // indirect
44-
golang.org/x/mod v0.12.0 // indirect
45-
golang.org/x/net v0.17.0 // indirect
46-
golang.org/x/sys v0.15.0 // indirect
43+
golang.org/x/mod v0.14.0 // indirect
44+
golang.org/x/net v0.20.0 // indirect
45+
golang.org/x/sys v0.16.0 // indirect
4746
golang.org/x/term v0.15.0 // indirect
48-
golang.org/x/tools v0.12.0 // indirect
47+
golang.org/x/tools v0.17.0 // indirect
4948
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
50-
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
5149
gopkg.in/yaml.v2 v2.4.0 // indirect
5250
gopkg.in/yaml.v3 v3.0.1 //indirect
5351
)

0 commit comments

Comments
 (0)