-
-
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
cksum: Adding the functionality for --zero. #6180
Conversation
GNU testsuite comparison:
|
src/uu/cksum/src/cksum.rs
Outdated
"{} ({}) = {sum}", | ||
options.algo_name.to_ascii_uppercase(), | ||
filename.display() | ||
); | ||
} | ||
} | ||
} | ||
match options.zero { |
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.
please use a if
no need for match here
could you please add a test? |
src/uu/cksum/src/cksum.rs
Outdated
if options.zero { | ||
print!("\0"); | ||
} else { | ||
print!("\n"); |
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.
print!("\n"); | |
println!(); |
GNU testsuite comparison:
|
Could you check out some of the other utils. I believe we added some functionality for this in uucore. I think it was called Edit: Here it is: https://docs.rs/uucore/latest/uucore/line_ending/enum.LineEnding.html. It's used in basename for example: https://github.com/uutils/coreutils/blob/main/src/uu/basename/src/basename.rs#L35 https://github.com/uutils/coreutils/blob/main/src/uu/basename/src/basename.rs#L70-L72 |
Changed to use |
is it ready to be reviewed? Thanks |
Unfortunately, school got busy and had to put this aside temporarily. Will be back on this in 1 week. |
Ping :) @orangeng Do you have time to finish this ? |
@RenjiSann thanks for reminding me haha, I unfortunately don't have time so I will close this PR. Feel free to have a go at it |
Adding the functionality for --zero / -z. As mentioned in issue #6178