-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
rm: -v -r should match GNU's output #1768
Comments
I would like to take this up if no one else is |
Interestingly, when I use rm -rf -v a, I don't get any output at all (on the rust implementation). Using latest version of Manjaro Linux, and the latest version of Rust stable. |
I noticed that the verbose option was not implemented at all for rm -rf -v, so I added a quick if statement to fix it. This commit would also fix uutils#1769, as it's one commit ahead of uutils#1780
I noticed that the verbose option was not implemented at all for rm -rf -v, so I added a quick if statement to fix it. This commit would also fix uutils#1769, as it's one commit ahead of uutils#1780
I also noticed that. However, I think the println fix should be inside Also note, that this test https://github.com/coreutils/coreutils/blob/master/tests/rm/v-slash.sh needs to be successful. #[test]
fn test_rm_verbose_slash() {
let (at, mut ucmd) = at_and_ucmd!();
let dir = "test_rm_verbose_slash_directory";
let file_a = &format!("{}/test_rm_verbose_slash_file_a", dir);
at.mkdir(dir);
at.touch(file_a);
ucmd.arg("-r")
.arg("-f")
.arg("-v")
.arg(&format!("{}///", dir))
.succeeds()
.stdout_only(format!(
"removed '{}'\nremoved directory '{}'\n",
file_a, dir
));
assert!(!at.dir_exists(dir));
assert!(!at.file_exists(file_a));
} |
@jhscheer Yeah that tripped me up too when I was writing my pull, I want to look for where remove_dir is called in the program but unfortunately my editor isn't all that great |
I looked at it some more. If However, the comment L249-250, indicates that
Is this the way to go? |
Uses the normalize_path used in cargo to strip duplicate slashes With a link to a std rfc rust-lang/rfcs#2208 This fixes uutils#1829 This also touches uutils#1768 but does not attempt to fully solve it
* rm: add verbose output and trim multiple slashes Uses the normalize_path used in cargo to strip duplicate slashes With a link to a std rfc rust-lang/rfcs#2208 This fixes #1829 This also touches #1768 but does not attempt to fully solve it
This was fixed in #1839 and can be closed. |
Another one that can be closed apparently :) |
thanks |
with rm from GNU:
With the Rust implementation:
The text was updated successfully, but these errors were encountered: