Merge pull request #6151 from BenWiederhake/dev-dirnames-repeated

dirname: accept repeated flag
This commit is contained in:
Sylvestre Ledru
2024-03-31 09:27:08 +02:00
committed by GitHub
2 changed files with 11 additions and 0 deletions
+1
View File
@@ -64,6 +64,7 @@ pub fn uu_app() -> Command {
.about(ABOUT)
.version(crate_version!())
.override_usage(format_usage(USAGE))
.args_override_self(true)
.infer_long_args(true)
.arg(
Arg::new(options::ZERO)
+10
View File
@@ -40,6 +40,16 @@ fn test_path_without_trailing_slashes_and_zero() {
.stdout_is("/root/alpha/beta/gamma/delta/epsilon\u{0}");
}
#[test]
fn test_repeated_zero() {
new_ucmd!()
.arg("--zero")
.arg("--zero")
.arg("foo/bar")
.succeeds()
.stdout_only("foo\u{0}");
}
#[test]
fn test_root() {
new_ucmd!().arg("/").run().stdout_is("/\n");