mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
id: mark passwd-format and pretty-print as conflicting
These are non-sensical to combine, and didn't work reasonably anyway. Also, passwd-formatting is our own extension, so there is no need for compatibility anyway.
This commit is contained in:
parent
e978fe5382
commit
4f5a3b4716
2 changed files with 14 additions and 0 deletions
|
@ -397,6 +397,7 @@ pub fn uu_app() -> Command {
|
||||||
Arg::new(options::OPT_PASSWORD)
|
Arg::new(options::OPT_PASSWORD)
|
||||||
.short('P')
|
.short('P')
|
||||||
.help("Display the id as a password file entry.")
|
.help("Display the id as a password file entry.")
|
||||||
|
.conflicts_with(options::OPT_HUMAN_READABLE)
|
||||||
.action(ArgAction::SetTrue),
|
.action(ArgAction::SetTrue),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
|
|
|
@ -461,3 +461,16 @@ fn test_id_no_specified_user_posixly() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
#[cfg(all(unix, not(target_os = "android")))]
|
||||||
|
fn test_id_pretty_print_password_record() {
|
||||||
|
// `-p` is BSD only and not supported on GNU's `id`.
|
||||||
|
// `-P` is our own extension, and not supported by either GNU nor BSD.
|
||||||
|
// These must conflict, because they both set the output format.
|
||||||
|
new_ucmd!()
|
||||||
|
.arg("-p")
|
||||||
|
.arg("-P")
|
||||||
|
.fails()
|
||||||
|
.stderr_contains("the argument '-p' cannot be used with '-P'");
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue