comm: Handle duplicated flags and output-delimiter correctly #6112
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR implements and tests correct handling of repeated arguments and flags.
This was non-trivial because GNU
comm
behaves a bit weirdly around repeated arguments for the output-delimiter:This PR mostly mirrors this behavior, however it cannot be done perfectly so, as indicated by the new (and ignored) test
output_delimiter_multiple_different_prevents_help
: Preventing--help
later in the command-line because some arguments are semantically contradictory seems like a bad idea.Note that this quirk cannot be reproduced (sensibly) with uutils-args, because
Options::apply
cannot indicate failure.However, I think this difference is firmly in the territory of "irrelevant for compatibility".
This is work towards #5998.