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

seq: Eliminated special handling of -0.0 #3055

Closed
wants to merge 16 commits into from
Closed

seq: Eliminated special handling of -0.0 #3055

wants to merge 16 commits into from

Conversation

palaster
Copy link
Contributor

@palaster palaster commented Feb 4, 2022

This PR addresses #2870
Removed special format handling around -0.0 in seq

@@ -212,7 +212,7 @@ fn write_value_float(
) -> std::io::Result<()> {
let value_as_str = if *value == ExtendedBigDecimal::MinusZero && is_first_iteration {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Does this first if statement still need to exist? I left it in because I am unsure about what is_first_iteration does

danieleades and others added 16 commits February 3, 2022 20:14
Now treats recognized command line options and ignores unrecognized
command line options instead of returning a special exit status for
them.

There is one point of interest, which is related to an implementation
detail in GNU `true`. It may return a non-true exit status (in
particular EXIT_FAIL) if writing the diagnostics of a GNU specific
option fails. For example `true --version > /dev/full` would fail and
have exit status 1.

	This behavior was acknowledged in gnu in commit
	<9a6a486e6503520fd2581f2d3356b7149f1b225d>. No further
	justification provided for keeping this quirk.

POSIX knows no such options, and requires an exit status of 0 in all
cases. We replicate GNU here which is a consistency improvement over the
prior implementation. Adds documentation to clarify the intended
behavior more properly.
This avoids hacking around the short options of these command line
arguments that have been introduced by clap. Additionally, we test and
correctly handle the combination of both version and help. The GNU
binary will ignore both arguments in this case while clap would perform
the first one. A test for this edge case was added.
Exit with status code 1 for argument parsing errors in `truncate`. When
`clap` encounters an error during argument parsing, it exits with status
code 2. This causes some GNU tests to fail since they expect status code
1.
)

* test_sort: Output sorted files to a file with different name

Signed-off-by: Hanif Bin Ariffin <[email protected]>

* Fix the test by saving the environment variable

Signed-off-by: Hanif Bin Ariffin <[email protected]>

Co-authored-by: Hanif Bin Ariffin <[email protected]>
@palaster palaster closed this Feb 4, 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.

6 participants