diff options
author | Peter Wemm <peter@FreeBSD.org> | 1996-10-21 07:30:26 +0000 |
---|---|---|
committer | Peter Wemm <peter@FreeBSD.org> | 1996-10-21 07:30:26 +0000 |
commit | db91faacb6575b5147c6bebd0f6d13587558a2e8 (patch) | |
tree | 6da5843225e613b5eb4f4456c650f4b7576cd2de /bin/ps/ps.c | |
parent | 92579404e8c58543982270d9b41600361ba0b0fd (diff) | |
download | src-db91faacb6575b5147c6bebd0f6d13587558a2e8.tar.gz src-db91faacb6575b5147c6bebd0f6d13587558a2e8.zip |
Implement a -c option to ps to display the short command name instead of
the full argument vector.
I've bumped into a few things that expected this switch to be present,
the most recent was the snmp package in ports. I'm not 100% sure of the
origins of this, but Linux has it, so does the "BSD-compatable" version
of ps on our SVR4 systems (so I assume SunOS has it too).
Notes
Notes:
svn path=/head/; revision=19068
Diffstat (limited to 'bin/ps/ps.c')
-rw-r--r-- | bin/ps/ps.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/bin/ps/ps.c b/bin/ps/ps.c index 058647171697..6f59124f0fa1 100644 --- a/bin/ps/ps.c +++ b/bin/ps/ps.c @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: ps.c,v 1.11 1996/01/12 08:49:43 peter Exp $ + * $Id: ps.c,v 1.12 1996/01/20 10:43:54 mpp Exp $ */ #ifndef lint @@ -77,6 +77,7 @@ KINFO *kinfo; struct varent *vhead, *vtail; int eval; /* exit value */ +int cflag; /* -c */ int rawcpu; /* -C */ int sumrusage; /* -S */ int termwidth; /* width of screen (0 == infinity) */ @@ -139,17 +140,20 @@ main(argc, argv) ttydev = NODEV; memf = nlistf = swapf = NULL; while ((ch = getopt(argc, argv, - "aCeghjLlM:mN:O:o:p:rSTt:U:uvW:wx")) != EOF) + "aCceghjLlM:mN:O:o:p:rSTt:U:uvW:wx")) != EOF) switch((char)ch) { case 'a': all = 1; break; - case 'e': /* XXX set ufmt */ - needenv = 1; - break; case 'C': rawcpu = 1; break; + case 'c': + cflag = 1; + break; + case 'e': /* XXX set ufmt */ + needenv = 1; + break; case 'g': break; /* no-op */ case 'h': |