fs.mv ensures there are 2 arguments

This commit is contained in:
Chris Lu 2021-03-20 06:34:09 -07:00
parent b2c1c209a5
commit 41cc6e661b

View file

@ -36,6 +36,10 @@ func (c *commandFsMv) Help() string {
func (c *commandFsMv) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) { 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]) sourcePath, err := commandEnv.parseUrl(args[0])
if err != nil { if err != nil {
return err return err