working commit

This commit is contained in:
2026-06-07 18:19:15 +02:00
parent d3556d397c
commit 0506b35cd1
26 changed files with 199 additions and 1299 deletions
+10 -10
View File
@@ -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,
}