1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 11:37:44 +00:00

cat: fix -b and -n anti-symmetry

This commit is contained in:
Ben Wiederhake 2024-03-01 12:18:26 +01:00
parent 100a48fda9
commit 472b56f0ff
2 changed files with 2 additions and 2 deletions

View file

@ -250,7 +250,8 @@ pub fn uu_app() -> Command {
.short('b') .short('b')
.long(options::NUMBER_NONBLANK) .long(options::NUMBER_NONBLANK)
.help("number nonempty output lines, overrides -n") .help("number nonempty output lines, overrides -n")
.overrides_with(options::NUMBER) // Note: This MUST NOT .overrides_with(options::NUMBER)!
// In clap, overriding is symmetric, so "-b -n" counts as "-n", which is not what we want.
.action(ArgAction::SetTrue), .action(ArgAction::SetTrue),
) )
.arg( .arg(

View file

@ -438,7 +438,6 @@ fn test_non_blank_overrides_number() {
} }
#[test] #[test]
#[ignore = "known issue"]
fn test_non_blank_overrides_number_even_when_present() { fn test_non_blank_overrides_number_even_when_present() {
new_ucmd!() new_ucmd!()
.args(&["-n", "-b", "-n"]) .args(&["-n", "-b", "-n"])