add command

Signed-off-by: xiang <xiang13225080@163.com>
This commit is contained in:
xiang 2022-01-07 03:42:32 +00:00
parent d50e985cbc
commit 345e544465
2 changed files with 4 additions and 2 deletions

View File

@ -36,6 +36,7 @@ func NewAttackCommand() *cobra.Command {
NewHostAttackCommand(&uid),
NewJVMAttackCommand(&uid),
NewClockAttackCommand(&uid),
NewFileAttackCommand(&uid),
)
return cmd

View File

@ -25,11 +25,12 @@ import (
"github.com/chaos-mesh/chaosd/pkg/utils"
)
func NewFileAttackCommand() *cobra.Command {
func NewFileAttackCommand(uid *string) *cobra.Command {
options := core.NewFileCommand()
dep := fx.Options(
server.Module,
fx.Provide(func() *core.FileCommand {
options.UID = *uid
return options
}),
)
@ -124,7 +125,7 @@ func NewFileRenameCommand(dep fx.Option, options *core.FileCommand) *cobra.Comma
func NewFileAppendCommand(dep fx.Option, options *core.FileCommand) *cobra.Command {
cmd := &cobra.Command{
Use: "append",
Use: "append",
Short: "append file",
Run: func(cmd *cobra.Command, args []string) {