Repository navigation
sort: let global -d override -i - #15643
ozenyunus35 wants to merge 1 commit into
Conversation
Merging this PR will not alter performance1 warning, 1 note
Comparing Footnotes
|
-i has no effect when -d is also given. The key options already did this, but the global -d -i applied both filters and dropped the control characters that -d keeps. Fixes uutils#15578.
abb2f92 to
c39edcc
Compare
Fixes #15578
-ishould have no effect when-dis also given (GNU manual: "This option has no effect if the stronger --dictionary-order (-d) option is also given"). The key-option parser already does this for-k1,1di. The global options copied both flags intoGlobalSettings, sosort -d -iused both filters and dropped the tabs and other control characters that-dkeeps.uumainnow setsignore_non_printingonly when-dis not given. The incompatible-options check still uses both flags. Its messages were already the same as GNU's, e.g.options '-dn' are incompatiblefor-n -d -i.I added
test_dictionary_order_overrides_non_printing, which checks-d -i,-i -d,-di,-idand-di -k1. It fails without the change, and alltest_sorttests and theuu_sortunit tests pass. I also compared-d -i,-i -d,-di,-id,-d -i -k1,1,-di -k2,-dir,-dif,-dand-iwith GNU 9.12 on input with tabs and control characters. The output was the same for all of them.cargo bench -p uu_sortshows no change against the merge base beyond run-to-run noise.I used an AI assistant to help draft parts of the code and tests; I reviewed the changes and ran the tests myself.