working commit
This commit is contained in:
@@ -13,15 +13,15 @@ import (
|
||||
)
|
||||
|
||||
type Util struct {
|
||||
oper *operator.Logic
|
||||
oper *operator.Operator
|
||||
operID string
|
||||
subCmd *cobra.Command
|
||||
createGrantParams createGrantParams
|
||||
deleteGrantParams deleteGrantParams
|
||||
setGrantParams SetGrantParams
|
||||
deleteGrantParams DeleteGrantParams
|
||||
commonParams CommonParams
|
||||
}
|
||||
|
||||
func NewUtil(oper *operator.Logic) *Util {
|
||||
func NewUtil(oper *operator.Operator) *Util {
|
||||
return &Util{
|
||||
oper: oper,
|
||||
}
|
||||
@@ -56,17 +56,17 @@ func (util *Util) BuildCmds() *cobra.Command {
|
||||
util.commonParams.Username = vi.GetString("user")
|
||||
util.commonParams.Password = vi.GetString("pass")
|
||||
|
||||
var createGrantCmd = &cobra.Command{
|
||||
Use: "create name|id password",
|
||||
Short: "Create grant",
|
||||
var setGrantCmd = &cobra.Command{
|
||||
Use: "set name|id password",
|
||||
Short: "Set grant for account",
|
||||
Args: cobra.ExactArgs(2),
|
||||
Run: util.CreateGrant,
|
||||
Run: util.SetGrant,
|
||||
}
|
||||
subCmd.AddCommand(createGrantCmd)
|
||||
subCmd.AddCommand(setGrantCmd)
|
||||
|
||||
var deleteGrantCmd = &cobra.Command{
|
||||
Use: "delete name|id grant",
|
||||
Short: "Delete grant",
|
||||
Short: "Delete grant for account",
|
||||
Args: cobra.ExactArgs(1),
|
||||
Run: util.DeleteGrant,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user