Skip to content

Commit 860a578

Browse files
RevanthTanneerumohammed786
authored andcommitted
Added output examples for CLI commands (#38)
1 parent 9601517 commit 860a578

21 files changed

Lines changed: 152 additions & 85 deletions

File tree

cmd/add/account/account.go

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,15 @@ func NewaccountCmd() *cobra.Command {
4141
opts := &account{}
4242
opts.Email = append(opts.Email, *EmailObj)
4343
cmd := &cobra.Command{
44-
Use: "account",
45-
Short: "add account",
46-
Long: `This commmand adds account`,
47-
Example: heredoc.Doc(`$ lr add account --name <name> --email <email>`),
44+
Use: "account",
45+
Short: "add account",
46+
Long: `This commmand adds account`,
47+
Example: heredoc.Doc(`$ lr add account --name <name> --email <email>
48+
User Account is successfully created
49+
First name is: <first name>
50+
Uid is: <uid>
51+
ID is: <id>
52+
`),
4853
RunE: func(cmd *cobra.Command, args []string) error {
4954
if opts.Email[0].Value == "" {
5055
return &cmdutil.FlagError{Err: errors.New("`email` is required argument")}

cmd/add/domain/domain.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,12 @@ func NewdomainCmd() *cobra.Command {
3131
opts := &domain{}
3232

3333
cmd := &cobra.Command{
34-
Use: "domain",
35-
Short: "add doamin",
36-
Long: `This commmand adds domain`,
37-
Example: heredoc.Doc(`$ lr add domain --domain <domain>`),
34+
Use: "domain",
35+
Short: "add doamin",
36+
Long: `This commmand adds domain`,
37+
Example: heredoc.Doc(`$ lr add domain --domain <domain>
38+
Your Domain <newDomain> is now whitelisted
39+
`),
3840
RunE: func(cmd *cobra.Command, args []string) error {
3941
if opts.Domain == "" {
4042
return &cmdutil.FlagError{Err: errors.New("`domain` is required argument")}

cmd/add/schema/schema.go

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,15 @@ var url1 string
2525
func NewschemaCmd() *cobra.Command {
2626

2727
cmd := &cobra.Command{
28-
Use: "schema",
29-
Short: "add schema config",
30-
Long: `This commmand adds schema config field`,
31-
Example: heredoc.Doc(`$ lr add schema`),
28+
Use: "schema",
29+
Short: "add schema config",
30+
Long: `This commmand adds schema config field`,
31+
Example: heredoc.Doc(`$ lr add schema
32+
Enter the Display Name (<Name>) :<Display Name>
33+
Is Required (y/n):<y/n>
34+
Do you want to setup advance configuration (y/n):<y/n>
35+
Your field has been sucessfully added
36+
`),
3237
RunE: func(cmd *cobra.Command, args []string) error {
3338
if temp == 0 {
3439
return &cmdutil.FlagError{Err: errors.New("`field` is required argument")}

cmd/add/social/social.go

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -49,18 +49,15 @@ func NewsocialCmd() *cobra.Command {
4949
Short: "add social provider",
5050
Long: `This commmand adds social provider`,
5151
Example: `$ lr add social
52-
1 Facebook
53-
2 Google
54-
3 Twitter
55-
4 LinkedIn
56-
5 GitHub
57-
Please select a number from 1 to 5
58-
:2
59-
Please enter the provider key:
60-
<key>
61-
Please enter the provider secret:
62-
<secret>
63-
social provider added successfully
52+
1 Facebook
53+
...
54+
Please select a number from 1 to 5
55+
:2
56+
Please enter the provider key:
57+
<key>
58+
Please enter the provider secret:
59+
<secret>
60+
social provider added successfully
6461
`,
6562
RunE: func(cmd *cobra.Command, args []string) error {
6663

cmd/delete/account/account.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,12 @@ type Result struct {
3131
func NewaccountCmd() *cobra.Command {
3232

3333
cmd := &cobra.Command{
34-
Use: "account",
35-
Short: "delete account",
36-
Long: `This commmand deletes account`,
37-
Example: heredoc.Doc(`$ lr delete account --email <email> (or) --uid <uid>`),
34+
Use: "account",
35+
Short: "delete account",
36+
Long: `This commmand deletes account`,
37+
Example: heredoc.Doc(`$ lr delete account --email <email> (or) --uid <uid>
38+
User account sucessfully deleted
39+
`),
3840
RunE: func(cmd *cobra.Command, args []string) error {
3941
if inpEmail == "" && inpUID != "" {
4042
return deletebyUID(inpUID)

cmd/delete/domain/domain.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,12 @@ func NewdomainCmd() *cobra.Command {
2626
opts := &domain{}
2727

2828
cmd := &cobra.Command{
29-
Use: "domain",
30-
Short: "delete domain",
31-
Long: `This commmand deletes domain`,
32-
Example: heredoc.Doc(`$ lr delete domain --domain <domain>`),
29+
Use: "domain",
30+
Short: "delete domain",
31+
Long: `This commmand deletes domain`,
32+
Example: heredoc.Doc(`$ lr delete domain --domain <domain>
33+
<doamin> is now removed from whitelisted domain."
34+
`),
3335
RunE: func(cmd *cobra.Command, args []string) error {
3436
if opts.Domain == "" {
3537
return &cmdutil.FlagError{Err: errors.New("`domain` is required argument")}

cmd/delete/schema/schema.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,12 @@ var field int
2121
func NewschemaCmd() *cobra.Command {
2222

2323
cmd := &cobra.Command{
24-
Use: "schema",
25-
Short: "delete schema",
26-
Long: `This commmand deletes schema fields`,
27-
Example: heredoc.Doc(`$ lr delete schema --fieldname <fieldname>`),
24+
Use: "schema",
25+
Short: "delete schema",
26+
Long: `This commmand deletes schema fields`,
27+
Example: heredoc.Doc(`$ lr delete schema --fieldname <fieldname>
28+
The field has been sucessfully deleted
29+
`),
2830
RunE: func(cmd *cobra.Command, args []string) error {
2931
if field == 0 {
3032
return &cmdutil.FlagError{Err: errors.New("`fieldname` is required argument")}

cmd/delete/social/social.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,12 @@ func NewsocialCmd() *cobra.Command {
2727
opts := &provider{}
2828

2929
cmd := &cobra.Command{
30-
Use: "social",
31-
Short: "delete social provider",
32-
Long: `This commmand deletes social provider`,
33-
Example: `$ lr delete social --provider <provider>`,
30+
Use: "social",
31+
Short: "delete social provider",
32+
Long: `This commmand deletes social provider`,
33+
Example: `$ lr delete social --provider <provider>
34+
successfully deleted
35+
`,
3436
RunE: func(cmd *cobra.Command, args []string) error {
3537
if opts.ProviderName == "" {
3638
return &cmdutil.FlagError{Err: errors.New("`provider` is require argument")}

cmd/generateSott/generateSott.go

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,16 @@ var url string
3434
func NewgenerateSottCmd() *cobra.Command {
3535
opts := &sott{}
3636
cmd := &cobra.Command{
37-
Use: "generate-sott",
38-
Short: "generates sott",
39-
Long: `This commmand generates sott`,
40-
Example: heredoc.Doc(`$ lr generate-sott -f <FromDate(mm/dd/yyyy)> -t <ToDate(mm/dd/yyyy)> -c <technology>`),
37+
Use: "generate-sott",
38+
Short: "generates sott",
39+
Long: `This commmand generates sott`,
40+
Example: heredoc.Doc(`$ lr generate-sott -f <FromDate(mm/dd/yyyy)> -t <ToDate(mm/dd/yyyy)> -c <technology>
41+
sott generated successfully
42+
AunthenticityToken: <token>
43+
Comment: <comment>
44+
Sott: <sott>
45+
Technology: <tech>
46+
`),
4147
RunE: func(cmd *cobra.Command, args []string) error {
4248
if opts.FromDate == "" || opts.ToDate == "" || opts.Technology == "" {
4349
if opts.FromDate == "" {

cmd/get/account/account.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,14 @@ type Result struct {
3030
func NewaccountCmd() *cobra.Command {
3131

3232
cmd := &cobra.Command{
33-
Use: "account",
34-
Short: "get account",
35-
Long: `This commmand gets account`,
36-
Example: heredoc.Doc(`$ lr get account --email <email>`),
33+
Use: "account",
34+
Short: "get account",
35+
Long: `This commmand gets account`,
36+
Example: heredoc.Doc(`$ lr get account --email <email>
37+
First name is:<firstname>
38+
Uid is:<uid>
39+
ID is:<id>
40+
`),
3741
RunE: func(cmd *cobra.Command, args []string) error {
3842
if inpEmail == "" {
3943
return &cmdutil.FlagError{Err: errors.New("`email` is required argument")}

0 commit comments

Comments
 (0)