mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
refactor(command_fs_rm): entiries
-> entries
(#3670)
Signed-off-by: Ryan Russell <git@ryanrussell.org> Signed-off-by: Ryan Russell <git@ryanrussell.org>
This commit is contained in:
parent
a36d7b77be
commit
c4363c4b5e
|
@ -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)
|
||||||
|
|
Loading…
Reference in a new issue