Bug #2733
closedpgrep/pkill prints misleading error on missing option argument
0%
Description
If you specify an option to pkill/pgrep that requires an argument without said argument, you get a somewhat confusing "illegal option" error instead of a more helpful "missing argument" error.
$ pkill c c
pkill: illegal option -
Usage: pkill [-signal] [-fnovx] [-P ppidlist] [-g pgrplist] [-s sidlist]
[-u euidlist] [-U uidlist] [-G gidlist] [-J projidlist]
[-T taskidlist] [-t termlist] [-z zonelist] [-c ctidlist] [pattern]
This should print 'missing argument' instead of 'illegal option'.
Updated by Eric Schrock about 10 years ago
- Status changed from New to Resolved
changeset: 13691:e1aca0f20bff
tag: tip
user: Eric Schrock <Eric.Schrock@delphix.com>
date: Mon May 14 12:05:00 2012 -0700
description:
2733 pgrep/pkill prints misleading error on missing option argument
Reviewed by: Robert Mustacchi <rm@joyent.com>
Reviewed by: Dan McDonald <danmcd@nexenta.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
modified:
usr/src/cmd/pgrep/pgrep.c