aboutsummaryrefslogtreecommitdiff
path: root/toys/pending/pgrep.c
diff options
context:
space:
mode:
Diffstat (limited to 'toys/pending/pgrep.c')
-rw-r--r--toys/pending/pgrep.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/toys/pending/pgrep.c b/toys/pending/pgrep.c
index 59767b9f..9117a6d5 100644
--- a/toys/pending/pgrep.c
+++ b/toys/pending/pgrep.c
@@ -91,14 +91,10 @@ void pgrep_main(void)
error_exit("Unknown signal '%s'", arg);
} else signum = SIGTERM;
}
- if (!(flag_chk(FLAG_s) || flag_chk(FLAG_P)) && !*toys.optargs) {
- toys.exithelp++;
- error_exit("missing argument");
- }
- if (*(toys.optargs+1) && !(flag_chk(FLAG_s) || flag_chk(FLAG_P))) {
- toys.exithelp++;
- error_exit("max argument > 1");
- }
+ if (!(flag_chk(FLAG_s) || flag_chk(FLAG_P)) && !*toys.optargs)
+ help_exit("missing argument");
+ if (*(toys.optargs+1) && !(flag_chk(FLAG_s) || flag_chk(FLAG_P)))
+ help_exit("max argument > 1");
if (*toys.optargs) { /* compile regular expression(PATTERN) */
if ((eval = regcomp(&rp, *toys.optargs, REG_EXTENDED | REG_NOSUB)) != 0) {
char errbuf[256];