mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-29 12:07:46 +00:00
sum: print filenames
This commit is contained in:
parent
156577ec40
commit
7cdcb8bf97
1 changed files with 7 additions and 1 deletions
|
@ -117,6 +117,8 @@ pub fn uumain(args: Vec<String>) -> int {
|
|||
matches.free
|
||||
};
|
||||
|
||||
let print_names = sysv || files.len() > 1;
|
||||
|
||||
for file in files.iter() {
|
||||
let reader = match open(file.as_slice()) {
|
||||
Ok(f) => f,
|
||||
|
@ -128,7 +130,11 @@ pub fn uumain(args: Vec<String>) -> int {
|
|||
bsd_sum(reader)
|
||||
};
|
||||
|
||||
println!("{} {}", sum, blocks);
|
||||
if print_names {
|
||||
println!("{} {} {}", sum, blocks, file);
|
||||
} else {
|
||||
println!("{} {}", sum, blocks);
|
||||
}
|
||||
}
|
||||
|
||||
0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue