Skip to content

Commit c94faaa

Browse files
committed
Updated Docs script and added command server-info
1 parent 4ec8db1 commit c94faaa

4 files changed

Lines changed: 15 additions & 15 deletions

File tree

cmd/add/sott/sott.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,9 @@ func NewSottCmd() *cobra.Command {
7272

7373
func generate(opts *sott) error {
7474
conf := config.GetInstance()
75-
fmt.Printf("Comment(optional): ")
76-
fmt.Scanf("%s\n", &opts.Comment)
75+
prompt.SurveyAskOne(&survey.Input{
76+
Message: "Comment(optional): ",
77+
}, &opts.Comment)
7778
opts.Encoded = false
7879
opts.Technology = getTech()
7980
if opts.Technology == "" {
@@ -90,7 +91,7 @@ func generate(opts *sott) error {
9091
if err != nil {
9192
return err
9293
}
93-
fmt.Println("sott generated successfully")
94+
fmt.Println("SOTT generated successfully")
9495
fmt.Println("AunthenticityToken: " + resultResp.AuthenticityToken)
9596
fmt.Println("Comment: " + resultResp.Comment)
9697
fmt.Println("Sott: " + resultResp.Sott)

cmd/get/get.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
"github.com/loginradius/lr-cli/cmd/get/sott"
1313

1414
"github.com/loginradius/lr-cli/cmd/get/domain"
15-
"github.com/loginradius/lr-cli/cmd/get/servertime"
15+
"github.com/loginradius/lr-cli/cmd/get/serverInfo"
1616
"github.com/loginradius/lr-cli/cmd/get/social"
1717
"github.com/loginradius/lr-cli/cmd/get/theme"
1818

@@ -48,8 +48,8 @@ func NewGetCmd() *cobra.Command {
4848
configCmd := config.NewConfigCmd()
4949
cmd.AddCommand(configCmd)
5050

51-
serverTimeCmd := servertime.NewServerTimeCmd()
52-
cmd.AddCommand(serverTimeCmd)
51+
serverInfoCmd := serverInfo.NewServerInfoCmd()
52+
cmd.AddCommand(serverInfoCmd)
5353

5454
socialCmd := social.NewsocialCmd()
5555
cmd.AddCommand(socialCmd)
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package servertime
1+
package serverInfo
22

33
import (
44
"encoding/json"
@@ -19,27 +19,27 @@ type Server struct {
1919

2020
var timediff *string
2121

22-
func NewServerTimeCmd() *cobra.Command {
22+
func NewServerInfoCmd() *cobra.Command {
2323
cmd := &cobra.Command{
24-
Use: "servertime",
24+
Use: "server-info",
2525
Short: "Shows basic server details",
2626
Long: heredoc.Doc(`
2727
Use this command to get the basic server information to use when creating the SOTT.
2828
`),
2929
Example: heredoc.Doc(`
30-
$ lr get servertime
30+
$ lr get server-info
3131
Server Information:
3232
...
3333
34-
$ lr get servertime --sott=<optional value> (Default=10)
34+
$ lr get server-info --sott=<optional value> (Default=10)
3535
Server Information:
3636
...
3737
Sott:
3838
...
3939
4040
`),
4141
RunE: func(cmd *cobra.Command, args []string) error {
42-
return servertime()
42+
return serverInfo()
4343
},
4444
}
4545

@@ -48,7 +48,7 @@ func NewServerTimeCmd() *cobra.Command {
4848
fl.Lookup("sott").NoOptDefVal = "10"
4949
return cmd
5050
}
51-
func servertime() error {
51+
func serverInfo() error {
5252
var resObj Server
5353
resp, err := request.RestLRAPI(http.MethodGet, "/identity/v2/serverinfo?timedifference="+*timediff, nil, "")
5454
if err != nil {

internal/docs/docs.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,12 @@ func GenMarkdownCustom(cmd *cobra.Command, w io.Writer, linkHandler func(string)
1919
buf := new(bytes.Buffer)
2020
name := cmd.CommandPath()
2121

22-
buf.WriteString(cmd.Short + "\n\n")
2322
if len(cmd.Long) > 0 {
24-
buf.WriteString("### Synopsis\n\n")
2523
buf.WriteString(cmd.Long + "\n\n")
2624
}
2725

2826
if cmd.Runnable() {
27+
buf.WriteString("### Syntax\n\n")
2928
buf.WriteString(fmt.Sprintf("```\n%s\n```\n\n", cmd.UseLine()))
3029
}
3130

0 commit comments

Comments
 (0)