Repository navigation
sort: reject incompatible modes across repeated --sort options - #15718
kmehltretter82 wants to merge 1 commit into
Conversation
cb98531 to
471cecf
Compare
Merging this PR will not alter performance1 warning, 1 note
Comparing Footnotes
|
--sort overrides earlier occurrences of itself in clap, so ModeFlags only sees the last --sort=<WORD> value. Passing conflicting modes such as --sort=general-numeric --sort=human-numeric, or -h followed by --sort=general-numeric --sort=human-numeric, drops the earlier value and skips the incompatibility check. Append --sort values in clap and collect every --sort occurrence in ModeFlags::from_matches. Repeated identical --sort values remain accepted, and conflicting modes now fail with "options '-...' are incompatible". Closes uutils#15596
471cecf to
96063d1
Compare
--sort overrides earlier occurrences of itself in clap, so ModeFlags only sees the last --sort= value. Passing conflicting modes such as --sort=general-numeric --sort=human-numeric, or -h followed by --sort=general-numeric --sort=human-numeric, drops the earlier value and skips the incompatibility check.
Append --sort values in clap and collect every --sort occurrence in ModeFlags::from_matches. Repeated identical --sort values remain accepted, and conflicting modes now fail with "options '-...' are incompatible".
Closes #15596