|
@ -37,10 +37,10 @@ func (c *commandFsRm) Help() string { |
|
|
func (c *commandFsRm) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) { |
|
|
func (c *commandFsRm) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) { |
|
|
isRecursive := false |
|
|
isRecursive := false |
|
|
ignoreRecursiveError := false |
|
|
ignoreRecursiveError := false |
|
|
var entiries []string |
|
|
|
|
|
|
|
|
var entries []string |
|
|
for _, arg := range args { |
|
|
for _, arg := range args { |
|
|
if !strings.HasPrefix(arg, "-") { |
|
|
if !strings.HasPrefix(arg, "-") { |
|
|
entiries = append(entiries, arg) |
|
|
|
|
|
|
|
|
entries = append(entries, arg) |
|
|
continue |
|
|
continue |
|
|
} |
|
|
} |
|
|
for _, t := range arg { |
|
|
for _, t := range arg { |
|
@ -52,12 +52,12 @@ func (c *commandFsRm) Do(args []string, commandEnv *CommandEnv, writer io.Writer |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
if len(entiries) < 1 { |
|
|
|
|
|
|
|
|
if len(entries) < 1 { |
|
|
return fmt.Errorf("need to have arguments") |
|
|
return fmt.Errorf("need to have arguments") |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
commandEnv.WithFilerClient(false, func(client filer_pb.SeaweedFilerClient) error { |
|
|
commandEnv.WithFilerClient(false, func(client filer_pb.SeaweedFilerClient) error { |
|
|
for _, entry := range entiries { |
|
|
|
|
|
|
|
|
for _, entry := range entries { |
|
|
targetPath, err := commandEnv.parseUrl(entry) |
|
|
targetPath, err := commandEnv.parseUrl(entry) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
fmt.Fprintf(writer, "rm: %s: %v\n", targetPath, err) |
|
|
fmt.Fprintf(writer, "rm: %s: %v\n", targetPath, err) |
|
|