From 41cc6e661b8208761a6512db6b8db57d906f0ed7 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sat, 20 Mar 2021 06:34:09 -0700 Subject: [PATCH] fs.mv ensures there are 2 arguments --- weed/shell/command_fs_mv.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/weed/shell/command_fs_mv.go b/weed/shell/command_fs_mv.go index 0a7eed02d..6b96072df 100644 --- a/weed/shell/command_fs_mv.go +++ b/weed/shell/command_fs_mv.go @@ -36,6 +36,10 @@ func (c *commandFsMv) Help() string { func (c *commandFsMv) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) { + if len(args) != 2 { + return fmt.Errorf("need to have 2 arguments.") + } + sourcePath, err := commandEnv.parseUrl(args[0]) if err != nil { return err