mirror of
https://github.com/uutils/coreutils
synced 2024-07-23 19:04:18 +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
|
@ -397,6 +397,7 @@ pub fn uu_app() -> Command {
|
|||
Arg::new(options::OPT_PASSWORD)
|
||||
.short('P')
|
||||
.help("Display the id as a password file entry.")
|
||||
.conflicts_with(options::OPT_HUMAN_READABLE)
|
||||
.action(ArgAction::SetTrue),
|
||||
)
|
||||
.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…
Reference in a new issue