frostfs-node/cmd/frostfs-cli/modules/object/root.go
Pavel Karpy 923f84722a Move to frostfs-node
Signed-off-by: Pavel Karpy <p.karpy@yadro.com>
2022-12-28 15:04:29 +03:00

47 lines
996 B
Go

package object
import (
"github.com/TrueCloudLab/frostfs-node/cmd/frostfs-cli/internal/commonflags"
"github.com/spf13/cobra"
)
// Cmd represents the object command.
var Cmd = &cobra.Command{
Use: "object",
Short: "Operations with Objects",
Long: `Operations with Objects`,
PersistentPreRun: func(cmd *cobra.Command, args []string) {
// bind exactly that cmd's flags to
// the viper before execution
commonflags.Bind(cmd)
commonflags.BindAPI(cmd)
},
}
func init() {
objectChildCommands := []*cobra.Command{
objectPutCmd,
objectDelCmd,
objectGetCmd,
objectSearchCmd,
objectHeadCmd,
objectHashCmd,
objectRangeCmd,
objectLockCmd}
Cmd.AddCommand(objectChildCommands...)
for _, objCommand := range objectChildCommands {
InitBearer(objCommand)
commonflags.InitAPI(objCommand)
}
initObjectPutCmd()
initObjectDeleteCmd()
initObjectGetCmd()
initObjectSearchCmd()
initObjectHeadCmd()
initObjectHashCmd()
initObjectRangeCmd()
initCommandObjectLock()
}