Skip to content

Commit 06bae0d

Browse files
authored
Merge pull request #7799 from BenWiederhake/dev-shred-verbose-no-padding
shred: remove unwanted padding in verbose messages
2 parents 36a6fe7 + af7a939 commit 06bae0d

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

src/uu/shred/src/shred.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ fn wipe_file(
484484
if verbose {
485485
let pass_name = pass_name(&pass_type);
486486
show_error!(
487-
"{}: pass {:2}/{total_passes} ({pass_name})...",
487+
"{}: pass {}/{total_passes} ({pass_name})...",
488488
path.maybe_quote(),
489489
i + 1,
490490
);

tests/by-util/test_shred.rs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,3 +208,25 @@ fn test_shred_fail_no_perm() {
208208
.fails()
209209
.stderr_contains("Couldn't rename to");
210210
}
211+
212+
#[test]
213+
fn test_shred_verbose_no_padding_1() {
214+
let (at, mut ucmd) = at_and_ucmd!();
215+
let file = "foo";
216+
at.write(file, "non-empty");
217+
ucmd.arg("-vn1")
218+
.arg(file)
219+
.succeeds()
220+
.stderr_only("shred: foo: pass 1/1 (random)...\n");
221+
}
222+
223+
#[test]
224+
fn test_shred_verbose_no_padding_10() {
225+
let (at, mut ucmd) = at_and_ucmd!();
226+
let file = "foo";
227+
at.write(file, "non-empty");
228+
ucmd.arg("-vn10")
229+
.arg(file)
230+
.succeeds()
231+
.stderr_contains("shred: foo: pass 1/10 (random)...\n");
232+
}

0 commit comments

Comments
 (0)