@@ -35,9 +35,15 @@ func CmdCreate() *cobra.Command {
35
35
Run : RunUpdate ,
36
36
}
37
37
cmd .Flags ().String ("email" , "" , "The email of the account that will be updated" )
38
- cmd .MarkFlagRequired ("email" )
38
+ err := cmd .MarkFlagRequired ("email" )
39
+ if err != nil {
40
+ log .Fatalf (`❌ Failed to mark email flag as required - %s` , err )
41
+ }
39
42
cmd .Flags ().String ("role_config" , "" , "The new value that the account's role_config should be set to" )
40
- cmd .MarkFlagRequired ("role_config" )
43
+ err = cmd .MarkFlagRequired ("role_config" )
44
+ if err != nil {
45
+ log .Fatalf (`❌ Failed to mark role_config flag as required - %s` , err )
46
+ }
41
47
return cmd
42
48
}
43
49
@@ -49,9 +55,15 @@ func CmdUpdate() *cobra.Command {
49
55
Run : RunUpdate ,
50
56
}
51
57
cmd .Flags ().String ("email" , "" , "The email of the account that will be updated" )
52
- cmd .MarkFlagRequired ("email" )
58
+ err := cmd .MarkFlagRequired ("email" )
59
+ if err != nil {
60
+ log .Fatalf (`❌ Failed to mark email flag as required - %s` , err )
61
+ }
53
62
cmd .Flags ().String ("role_config" , "" , "The new value that the account's role_config should be set to" )
54
- cmd .MarkFlagRequired ("role_config" )
63
+ err = cmd .MarkFlagRequired ("role_config" )
64
+ if err != nil {
65
+ log .Fatalf (`❌ Failed to mark role_config flag as required - %s` , err )
66
+ }
55
67
return cmd
56
68
}
57
69
@@ -63,7 +75,10 @@ func CmdRemove() *cobra.Command {
63
75
Run : RunRemove ,
64
76
}
65
77
cmd .Flags ().String ("email" , "" , "The email of the account that will be updated" )
66
- cmd .MarkFlagRequired ("email" )
78
+ err := cmd .MarkFlagRequired ("email" )
79
+ if err != nil {
80
+ log .Fatalf (`❌ Failed to mark email flag as required - %s` , err )
81
+ }
67
82
return cmd
68
83
}
69
84
@@ -90,6 +105,9 @@ func RunUpdate(cmd *cobra.Command, args []string) {
90
105
}
91
106
readAccountParams := nb.ReadAccountParams {Email : email }
92
107
accountInfo , err := NBClient .ReadAccountAPI (readAccountParams )
108
+ if err != nil {
109
+ log .Fatalf (`❌ Failed to read account - %s` , err )
110
+ }
93
111
UpdateAccountParams := nb.UpdateAccountParams {
94
112
Email : email ,
95
113
AllowedIPs : accountInfo .AllowedIPs ,
0 commit comments