mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 03:27:44 +00:00
dirname: accept repeated flag
This commit is contained in:
parent
c99e1c6813
commit
9dbf2c362d
2 changed files with 11 additions and 0 deletions
|
@ -64,6 +64,7 @@ pub fn uu_app() -> Command {
|
||||||
.about(ABOUT)
|
.about(ABOUT)
|
||||||
.version(crate_version!())
|
.version(crate_version!())
|
||||||
.override_usage(format_usage(USAGE))
|
.override_usage(format_usage(USAGE))
|
||||||
|
.args_override_self(true)
|
||||||
.infer_long_args(true)
|
.infer_long_args(true)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new(options::ZERO)
|
Arg::new(options::ZERO)
|
||||||
|
|
|
@ -40,6 +40,16 @@ fn test_path_without_trailing_slashes_and_zero() {
|
||||||
.stdout_is("/root/alpha/beta/gamma/delta/epsilon\u{0}");
|
.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]
|
#[test]
|
||||||
fn test_root() {
|
fn test_root() {
|
||||||
new_ucmd!().arg("/").run().stdout_is("/\n");
|
new_ucmd!().arg("/").run().stdout_is("/\n");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue