-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add multiple args to rm #49
Conversation
FYI the image link doesn't work |
return err | ||
} | ||
for i := range args { | ||
path, err := validatePath(args[i]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we do validation on all args before executing on any arg?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, If there are multiple arguments and one doesn't exist, should the others still be removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, lets just fail fast if validation fails.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, should have that fixed today.
@diwakergupta updated link, not sure why that was happening |
Signed-off-by: grantseltzer <grantseltzer@gmail.com>
@diwakergupta I've updated this PR to now validate and check meta data before removing. It will fail if any arguments are invalid and nothing will be removed. |
Thanks @grantseltzer . One thing I want to start doing is wherever we have multiple file operations, we can easily parallelize them, especially in Go via goroutines. That should help w/ performance, as the number of args increase. |
Excellent idea! I'll work on that for future contributions. Thanks for the merge @diwakergupta! |
This just adds a loop around the functionality of
rm
to now support multiple arguments.Link to example usage: http://i.imgur.com/Fm71rR6.png