@@ -11,7 +11,7 @@ import (
1111
1212func NewPrivilegeCmd (target string ) * cobra.Command {
1313 cmd := & cobra.Command {
14- Use : "privileges" ,
14+ Use : "privileges" ,
1515 Short : fmt .Sprintf ("Change %s privileges" , target ),
1616 }
1717
@@ -21,23 +21,22 @@ func NewPrivilegeCmd(target string) *cobra.Command {
2121 return cmd
2222}
2323
24-
2524type Privilege struct {
26- Granted bool `json:"granted"`
25+ Granted bool `json:"granted"`
2726 ExpirationDate int64 `json:"expiration_date"`
2827}
2928
3029type Privileges map [string ]Privilege
3130
3231func NewPrivilegeGrantCmd (target string ) * cobra.Command {
3332 cmd := & cobra.Command {
34- Use : fmt .Sprintf ("grant [%sname] [privilege]..." , target ),
35- Short : fmt .Sprintf ("Grant privileges to a %s" , target ),
33+ Use : fmt .Sprintf ("grant [%sname] [privilege]..." , target ),
34+ Short : fmt .Sprintf ("Grant privileges to a %s" , target ),
3635 Example : fmt .Sprintf (" vt %s privileges grant my%s intelligence downloads-tier-2" , target , target ),
37- Args : cobra .MinimumNArgs (2 ),
36+ Args : cobra .MinimumNArgs (2 ),
3837 RunE : func (cmd * cobra.Command , args []string ) error {
3938 var expirationDate int64
40- if expiration := viper .GetString ("expiration" ); expiration != "" {
39+ if expiration := viper .GetString ("expiration" ); expiration != "" {
4140 var err error
4241 expirationDate , err = strconv .ParseInt (expiration , 10 , 64 )
4342 if err != nil {
@@ -68,18 +67,18 @@ func NewPrivilegeGrantCmd(target string) *cobra.Command {
6867 },
6968 }
7069
71- cmd .Flags ().StringP ("" +
70+ cmd .Flags ().StringP ("" +
7271 "expiration" , "e" , "" ,
7372 "expiration time for the granted privileges (UNIX timestamp or YYYY-MM-DD)" )
7473 return cmd
7574}
7675
7776func NewPrivilegeRevokeCmd (target string ) * cobra.Command {
7877 return & cobra.Command {
79- Use : fmt .Sprintf ("revoke [%sname] [privilege]..." , target ),
80- Short : fmt .Sprintf ("Revoke privileges from a %s" , target ),
78+ Use : fmt .Sprintf ("revoke [%sname] [privilege]..." , target ),
79+ Short : fmt .Sprintf ("Revoke privileges from a %s" , target ),
8180 Example : fmt .Sprintf (" vt %s privileges revoke my%s intelligence downloads-tier-2" , target , target ),
82- Args : cobra .MinimumNArgs (2 ),
81+ Args : cobra .MinimumNArgs (2 ),
8382 RunE : func (cmd * cobra.Command , args []string ) error {
8483 privileges := Privileges {}
8584 for _ , arg := range args [1 :] {
0 commit comments