Repository navigation
Conversation
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
|
Added in ed025f5: |
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
sortkeeps only the last--checkvalue, so a silent and a diagnosing check mode given together are not rejected:GNU sort rejects this with
sort: options '-cC' are incompatible(exit 2), as it already does for-c -C. The reverse case was wrong too:--check=quiet -Cwas rejected even though both modes are silent, and GNU accepts it.With this change,
--checkcollects all of its values (a bare-c/--checkcounts asdiagnose-first). The check is silent if-Cor any--check=silent|quietis given, and diagnosing if any bare-cor--check=diagnose-firstis given. Having both is rejected with the-cCerror, and repeating the same mode is fine. I compared these cases against GNU sort 8.32:--check=silent --check=diagnose-first-cCincompatible, 2-cCincompatible, 2-c --check=quiet-cCincompatible, 2-cCincompatible, 2--check=quiet -C-cCincompatible, 2--check=quiet --check=silent--check=diagnose-first -c-c=VALUEitself (with a short option) is still accepted. I left that out because it's clap'srequire_equalsbehavior for the shared-c/--checkargument.Fixes #15595
Tests: added
test_check_repeated_modes. It fails onmain(--check=silent --check=diagnose-firstexits 1 with the disorder message) and passes with this change.cargo test --features sort --no-default-features -- test_sort::gives 193 passed, 6 failed on Windows. The 6 failures (test_compress_fail,test_ext_sort_preserves_long_lines,test_merge_batch_size,test_merge_batches,test_output_is_input,test_unterminated_file_not_fused_across_chunk_boundary) fail the same way onmainon my Windows machine.cargo fmt --checkandcargo clippy -p uu_sort -- -D warningsare clean.