-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat(sort): add warning messages for obsolescent keys and options #9900
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
base: main
Are you sure you want to change the base?
Conversation
Added localized warning messages in en-US.ftl for various sort command issues, including obsolescent key formats, ignored options, and locale-related warnings. Implemented LegacyKeyWarning struct and GlobalOptionFlags in sort.rs to detect deprecated key syntax (e.g., +field -field) and suggest modern -k replacements, improving user guidance and compatibility.
Removes the unused `stable` and `unique` boolean fields from the GlobalOptionFlags struct and their initialization in the impl block, simplifying the code by eliminating redundant options.
|
GNU testsuite comparison: |
Previously, sort mode flags were mutually exclusive, preventing users from specifying more than one mode. This change removes the conflicts to enable combining sort options for more flexible sorting behavior.
CodSpeed Performance ReportMerging #9900 will not alter performanceComparing Summary
Footnotes
|
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
|
thanks. It needs some tests |
|
also, please have a look on the perf regression - -4.52% is quite high |
|
GNU testsuite comparison: |
- Update LegacyKeyWarning struct to include arg_index and make key_index optional - Modify preprocess_legacy_args to set arg_index instead of key_index during parsing - Add index_legacy_warnings function to compute key_index after arg processing - Adjust emit_debug_warnings to match updated key_index type - This ensures accurate indexing for legacy key warnings in sort utility
|
GNU testsuite comparison: |
- Introduce `starts_with_plus` function to check for arguments starting with '+' in a platform-specific manner - Modify `parse_sort_arguments` to detect and process legacy sort keys, enabling proper handling of deprecated options with warnings - This ensures backward compatibility for users relying on old sort syntax while guiding migration to modern flags
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
Remove intermediate vector creation in preprocess_legacy_args and streamline the handling of legacy '+' prefixed arguments to improve efficiency and readability without altering functionality. Additionally, refactor uumain to directly index legacy warnings when present.
|
GNU testsuite comparison: |
…g args Move output file creation and argument setup outside benchmark loops in sort_locale_utf8_bench.rs to avoid measuring initialization time in each iteration, ensuring accurate performance measurements for sorting operations.
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
Added localized warning messages in en-US.ftl for various sort command issues, including obsolescent key formats, ignored options, and locale-related warnings. Implemented LegacyKeyWarning struct and GlobalOptionFlags in sort.rs to detect deprecated key syntax (e.g., +field -field) and suggest modern -k replacements, improving user guidance and compatibility.
fix
sort/sort-debug-warn.sh