mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 03:27:44 +00:00
chroot: make group option self overwriting
This commit is contained in:
parent
b9765a746b
commit
924d40867c
2 changed files with 17 additions and 0 deletions
|
@ -254,6 +254,7 @@ pub fn uu_app() -> Command {
|
|||
.arg(
|
||||
Arg::new(options::GROUPS)
|
||||
.long(options::GROUPS)
|
||||
.overrides_with(options::GROUPS)
|
||||
.help("Comma-separated list of groups to switch to")
|
||||
.value_name("GROUP1,GROUP2..."),
|
||||
)
|
||||
|
|
|
@ -53,6 +53,22 @@ fn test_no_such_directory() {
|
|||
.code_is(125);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_multiple_group_args() {
|
||||
let ts = TestScenario::new(util_name!());
|
||||
let at = &ts.fixtures;
|
||||
at.mkdir("id");
|
||||
|
||||
if let Ok(result) = run_ucmd_as_root(
|
||||
&ts,
|
||||
&["--groups='invalid ignored'", "--groups=''", "/", "id", "-G"],
|
||||
) {
|
||||
result.success().stdout_is("0");
|
||||
} else {
|
||||
print!("Test skipped; requires root user");
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_invalid_user_spec() {
|
||||
let ts = TestScenario::new(util_name!());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue