summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOkan Demirmen <okan@cvs.openbsd.org>2013-10-28 13:05:54 +0000
committerOkan Demirmen <okan@cvs.openbsd.org>2013-10-28 13:05:54 +0000
commit524cba0e55fd09395e70bfd7c48fd4fe7749755f (patch)
treef55526932eeabc4ed556929cd1759db2b7f4cd91
parent224454b9db239a5794162870ee8fb842802b10a6 (diff)
add -A (-ax) support; from Lauri Tirkkonen with some option sorting.
ok guenther@ jmc@
-rw-r--r--bin/ps/ps.19
-rw-r--r--bin/ps/ps.c16
2 files changed, 16 insertions, 9 deletions
diff --git a/bin/ps/ps.1 b/bin/ps/ps.1
index db600bf880c..a69fed11dc4 100644
--- a/bin/ps/ps.1
+++ b/bin/ps/ps.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: ps.1,v 1.85 2013/10/08 03:50:08 guenther Exp $
+.\" $OpenBSD: ps.1,v 1.86 2013/10/28 13:05:53 okan Exp $
.\" $NetBSD: ps.1,v 1.16 1996/03/21 01:36:28 jtc Exp $
.\"
.\" Copyright (c) 1980, 1990, 1991, 1993, 1994
@@ -30,7 +30,7 @@
.\"
.\" @(#)ps.1 8.3 (Berkeley) 4/18/94
.\"
-.Dd $Mdocdate: October 8 2013 $
+.Dd $Mdocdate: October 28 2013 $
.Dt PS 1
.Os
.Sh NAME
@@ -39,7 +39,7 @@
.Sh SYNOPSIS
.Nm ps
.Sm off
-.Op Fl aCceHhjkLlmrSTuvwx
+.Op Fl AaCceHhjkLlmrSTuvwx
.Sm on
.Op Fl M Ar core
.Op Fl N Ar system
@@ -71,6 +71,9 @@ and associated command.
.Pp
The options are as follows:
.Bl -tag -width Ds
+.It Fl A
+Display information about all processes, including those without controlling
+terminals.
.It Fl a
Display information about other users' processes as well as your own.
.It Fl C
diff --git a/bin/ps/ps.c b/bin/ps/ps.c
index c321963a4c2..9ef6084ddc8 100644
--- a/bin/ps/ps.c
+++ b/bin/ps/ps.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ps.c,v 1.56 2013/09/22 17:28:34 guenther Exp $ */
+/* $OpenBSD: ps.c,v 1.57 2013/10/28 13:05:53 okan Exp $ */
/* $NetBSD: ps.c,v 1.15 1995/05/18 20:33:25 mycroft Exp $ */
/*-
@@ -116,20 +116,24 @@ main(int argc, char *argv[])
ttydev = NODEV;
memf = nlistf = swapf = NULL;
while ((ch = getopt(argc, argv,
- "acCegHhjkLlM:mN:O:o:p:rSTt:U:uvW:wx")) != -1)
+ "AaCcegHhjkLlM:mN:O:o:p:rSTt:U:uvW:wx")) != -1)
switch (ch) {
+ case 'A':
+ all = 1;
+ xflg = 1;
+ break;
case 'a':
all = 1;
break;
+ case 'C':
+ rawcpu = 1;
+ break;
case 'c':
commandonly = 1;
break;
case 'e': /* XXX set ufmt */
needenv = 1;
break;
- case 'C':
- rawcpu = 1;
- break;
case 'g':
break; /* no-op */
case 'H':
@@ -462,7 +466,7 @@ static void
usage(void)
{
(void)fprintf(stderr,
- "usage: %s [-aCceHhjkLlmrSTuvwx] [-M core] [-N system] [-O fmt] [-o fmt] [-p pid]\n",
+ "usage: %s [-AaCceHhjkLlmrSTuvwx] [-M core] [-N system] [-O fmt] [-o fmt] [-p pid]\n",
__progname);
(void)fprintf(stderr,
"%-*s[-t tty] [-U username] [-W swap]\n", (int)strlen(__progname) + 8, "");