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:
Ryan Russell 2022-09-14 13:24:27 -05:00 committed by GitHub
parent a36d7b77be
commit c4363c4b5e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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)