Skip to content
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

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

orangeng
Copy link

@orangeng orangeng commented Apr 2, 2024

Adding the functionality for --zero / -z. As mentioned in issue #6178

@cakebaker cakebaker linked an issue Apr 2, 2024 that may be closed by this pull request
Copy link

github-actions bot commented Apr 2, 2024

GNU testsuite comparison:

Skip an intermittent issue tests/tail/inotify-dir-recreate (fails in this run but passes in the 'main' branch)

"{} ({}) = {sum}",
options.algo_name.to_ascii_uppercase(),
filename.display()
);
}
}
}
match options.zero {
Copy link
Sponsor Contributor

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

@sylvestre
Copy link
Sponsor Contributor

could you please add a test?
thanks

if options.zero {
print!("\0");
} else {
print!("\n");
Copy link
Sponsor Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
print!("\n");
println!();

Copy link

github-actions bot commented Apr 2, 2024

GNU testsuite comparison:

Skip an intermittent issue tests/tail/inotify-dir-recreate (fails in this run but passes in the 'main' branch)

@tertsdiepraam
Copy link
Member

tertsdiepraam commented Apr 2, 2024

Could you check out some of the other utils. I believe we added some functionality for this in uucore. I think it was called LineEnding.

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

@orangeng
Copy link
Author

orangeng commented Apr 15, 2024

Changed to use LineEnding. As a general question, is there a good way to know if a needed code function is found in uucore and what is not?

@sylvestre
Copy link
Sponsor Contributor

is it ready to be reviewed? Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cksum: implement -z
3 participants