2022-05-18 11:17:31 +00:00
|
|
|
package accounting
|
|
|
|
|
|
|
|
import (
|
2023-05-24 11:50:19 +00:00
|
|
|
"git.frostfs.info/TrueCloudLab/frostfs-node/cmd/frostfs-cli/internal/common"
|
2023-03-07 13:38:26 +00:00
|
|
|
"git.frostfs.info/TrueCloudLab/frostfs-node/cmd/frostfs-cli/internal/commonflags"
|
2022-05-18 11:17:31 +00:00
|
|
|
"github.com/spf13/cobra"
|
|
|
|
"github.com/spf13/viper"
|
|
|
|
)
|
|
|
|
|
2022-10-17 12:03:55 +00:00
|
|
|
// Cmd represents the accounting command.
|
2022-05-18 11:17:31 +00:00
|
|
|
var Cmd = &cobra.Command{
|
|
|
|
Use: "accounting",
|
|
|
|
Short: "Operations with accounts and balances",
|
|
|
|
Long: `Operations with accounts and balances`,
|
|
|
|
PersistentPreRun: func(cmd *cobra.Command, args []string) {
|
|
|
|
flags := cmd.Flags()
|
|
|
|
|
|
|
|
_ = viper.BindPFlag(commonflags.WalletPath, flags.Lookup(commonflags.WalletPath))
|
|
|
|
_ = viper.BindPFlag(commonflags.Account, flags.Lookup(commonflags.Account))
|
|
|
|
_ = viper.BindPFlag(commonflags.RPC, flags.Lookup(commonflags.RPC))
|
2023-05-24 11:50:19 +00:00
|
|
|
common.StartClientCommandSpan(cmd)
|
2022-05-18 11:17:31 +00:00
|
|
|
},
|
2023-05-24 11:50:19 +00:00
|
|
|
PersistentPostRun: common.StopClientCommandSpan,
|
2022-05-18 11:17:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
Cmd.AddCommand(accountingBalanceCmd)
|
|
|
|
|
|
|
|
initAccountingBalanceCmd()
|
|
|
|
}
|