working commit

This commit is contained in:
2026-06-06 18:48:40 +02:00
parent 3a5f624ba4
commit 25d01fc940
16 changed files with 107 additions and 61 deletions
+10 -7
View File
@@ -7,17 +7,18 @@ import (
"os"
"path/filepath"
"mbase/cmd/mbaseadmin/account"
"mbase/app/config"
"mbase/app/maindb"
"mbase/app/operator"
"mbase/cmd/mbaseadmin/account"
"mbase/cmd/mbaseadmin/grant"
"github.com/spf13/cobra"
)
type Util struct {
lg *operator.Logic
db *maindb.Database
lg *operator.Logic
db *maindb.Database
rootCmd *cobra.Command
}
@@ -32,7 +33,7 @@ func (util *Util) GetRooCmd() *cobra.Command {
func (util *Util) Build() error {
var err error
conf := config.NewConfig()
conf := config.NewConfig()
err = conf.ReadFile()
if err != nil {
return err
@@ -67,8 +68,11 @@ func (util *Util) Build() error {
}
rootCmd.CompletionOptions.DisableDefaultCmd = true
accountUtil := account.NewUtil(util.lg)
rootCmd.AddCommand(accountUtil.BuildCmds())
accountUtil := account.NewUtil(util.lg)
rootCmd.AddCommand(accountUtil.BuildCmds())
grantUtil := grant.NewUtil(util.lg)
rootCmd.AddCommand(grantUtil.BuildCmds())
util.rootCmd = rootCmd
return err
@@ -80,4 +84,3 @@ func (util *Util) Exec(args []string) error {
err = util.rootCmd.Execute()
return err
}