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

join: print unsorted line in error message #2899

Merged
merged 1 commit into from
Jan 21, 2022

Conversation

cohosh
Copy link
Contributor

@cohosh cohosh commented Jan 21, 2022

This expands the error message that is printed if either input file has
an unsorted line. Both the program name (join) and the offending line
are printed out with the message to match the behaviour of the GNU
utility.

Note: while copying the input string with clone may look bad, this makes the Sep::Line arm have the same performance as the rest of the match arms (which clone the input line in their calls to Vec::from).

@jtracey jtracey mentioned this pull request Jan 21, 2022
10 tasks
Copy link
Member

@tertsdiepraam tertsdiepraam left a comment

Choose a reason for hiding this comment

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

Nice work! I just have one small suggestion and one test needs to be adapted for this change.
You can run the tests yourself to check before you push with:

cargo test --features join --no-default-features

Those flags will ensure that only join is compiled and tested, saving some time.

src/uu/join/src/join.rs Show resolved Hide resolved
src/uu/join/src/join.rs Outdated Show resolved Hide resolved
@cohosh cohosh force-pushed the join_chkodr_error_fix branch from 914b3d1 to d2348a2 Compare January 21, 2022 15:35
@cohosh
Copy link
Contributor Author

cohosh commented Jan 21, 2022

Thank you for the feedback, this is ready for another review :)

@cohosh
Copy link
Contributor Author

cohosh commented Jan 21, 2022

Whoops, still getting the hang of cargo fmt, I'll have a fix for that shortly.

This expands the error message that is printed if either input file has
an unsorted line. Both the program name (join) and the offending line
are printed out with the message to match the behaviour of the GNU
utility.
@cohosh cohosh force-pushed the join_chkodr_error_fix branch from d2348a2 to 67878de Compare January 21, 2022 16:47
Copy link
Member

@tertsdiepraam tertsdiepraam left a comment

Choose a reason for hiding this comment

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

Thanks for the fixes! We can merge this once the CI is green.

@tertsdiepraam tertsdiepraam merged commit 8c53854 into uutils:main Jan 21, 2022
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.

2 participants