Skip to content

Commit d70f9a7

Browse files
Merge pull request #359 from cakebaker/pidof_dont_require_program_name
pidof: don't require program name
2 parents dd470f4 + 5ca17df commit d70f9a7

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

src/uu/pidof/src/pidof.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ pub fn uu_app() -> Command {
117117
.arg(
118118
Arg::new("program-name")
119119
.help("Program name.")
120-
.required(true)
121120
.index(1)
122121
.action(ArgAction::Append),
123122
)

tests/by-util/test_pidof.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55

66
use crate::common::util::TestScenario;
77

8+
#[test]
9+
fn test_no_args() {
10+
new_ucmd!().fails().code_is(1).no_output();
11+
}
12+
813
#[test]
914
fn test_invalid_arg() {
1015
new_ucmd!().arg("--definitely-invalid").fails().code_is(1);
@@ -23,12 +28,6 @@ fn test_find_kthreadd() {
2328
new_ucmd!().arg("kthreadd").succeeds();
2429
}
2530

26-
#[test]
27-
#[cfg(target_os = "linux")]
28-
fn test_no_program() {
29-
new_ucmd!().fails().code_is(1);
30-
}
31-
3231
#[test]
3332
#[cfg(target_os = "linux")]
3433
fn test_no_pid_found() {

0 commit comments

Comments
 (0)