diff --git a/src/uu/realpath/src/realpath.rs b/src/uu/realpath/src/realpath.rs index 813c463fa..b5f9ebd11 100644 --- a/src/uu/realpath/src/realpath.rs +++ b/src/uu/realpath/src/realpath.rs @@ -171,6 +171,7 @@ pub fn uu_app() -> Command { .arg( Arg::new(ARG_FILES) .action(ArgAction::Append) + .required(true) .value_parser(NonEmptyStringValueParser::new()) .value_hint(clap::ValueHint::AnyPath), ) diff --git a/tests/by-util/test_realpath.rs b/tests/by-util/test_realpath.rs index 780110fbe..fdbead59f 100644 --- a/tests/by-util/test_realpath.rs +++ b/tests/by-util/test_realpath.rs @@ -453,3 +453,8 @@ fn test_realpath_trailing_slash() { .succeeds() .stdout_contains(format!("{}no_dir\n", std::path::MAIN_SEPARATOR)); } + +#[test] +fn test_realpath_empty() { + new_ucmd!().fails().code_is(1); +}