forked from TrueCloudLab/frostfs-node
[#1383] neofs-cli: move object
command to a separate package
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
parent
12bc5607f7
commit
a219e3a667
15 changed files with 1237 additions and 1190 deletions
47
cmd/neofs-cli/modules/object/root.go
Normal file
47
cmd/neofs-cli/modules/object/root.go
Normal file
|
@ -0,0 +1,47 @@
|
|||
package object
|
||||
|
||||
import (
|
||||
"github.com/nspcc-dev/neofs-node/cmd/neofs-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()
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue