mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07:00
fix(sort): skip ordering incompatibility check when --key is specified
Previously, the ordering_incompatible check was performed unconditionally, causing errors even when the --key option was used, where such incompatibilities might not apply. This change adds a condition to skip the check if --key is present, ensuring correct behavior for key-based sorting.
This commit is contained in:
@@ -2081,7 +2081,9 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
||||
let ignore_non_printing = matches.get_flag(options::IGNORE_NONPRINTING);
|
||||
let ignore_case = matches.get_flag(options::IGNORE_CASE);
|
||||
|
||||
if ordering_incompatible(mode_flags, dictionary_order, ignore_non_printing) {
|
||||
if !matches.contains_id(options::KEY)
|
||||
&& ordering_incompatible(mode_flags, dictionary_order, ignore_non_printing)
|
||||
{
|
||||
let opts = ordering_opts_string(
|
||||
mode_flags,
|
||||
dictionary_order,
|
||||
|
||||
Reference in New Issue
Block a user