Merge pull request #4452 from cakebaker/comm_allow_multiple_occurrence_of_zero_terminated

comm: allow multiple occurrence of --zero-terminated
This commit is contained in:
Terts Diepraam 2023-03-02 19:02:20 +01:00 committed by GitHub
commit 89bd9098e1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 0 deletions

View file

@ -236,6 +236,7 @@ pub fn uu_app() -> Command {
Arg::new(options::ZERO_TERMINATED)
.long(options::ZERO_TERMINATED)
.short('z')
.overrides_with(options::ZERO_TERMINATED)
.help("line delimiter is NUL, not newline")
.action(ArgAction::SetTrue),
)

View file

@ -105,6 +105,16 @@ fn zero_terminated() {
}
}
#[test]
fn zero_terminated_provided_multiple_times() {
for param in ["-z", "--zero-terminated"] {
new_ucmd!()
.args(&[param, param, param, "a_nul", "b_nul"])
.succeeds()
.stdout_only_fixture("ab_nul.expected");
}
}
#[test]
fn zero_terminated_with_total() {
for param in ["-z", "--zero-terminated"] {