summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1999-08-12 19:26:40 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1999-08-12 19:26:40 +0000
commit2c07facc4d37e4947339c3f6fcc68b3a510c6f63 (patch)
tree7a9f8edf948d0a163464fed36ea599787c4f84af
parent75b469e57b062abe418002c5a2b6f6ad9d6c835e (diff)
Support -M and -N flags in uptime mode too
-rw-r--r--usr.bin/w/uptime.129
-rw-r--r--usr.bin/w/w.116
-rw-r--r--usr.bin/w/w.c6
3 files changed, 33 insertions, 18 deletions
diff --git a/usr.bin/w/uptime.1 b/usr.bin/w/uptime.1
index c4f1b264201..ddc2ef15425 100644
--- a/usr.bin/w/uptime.1
+++ b/usr.bin/w/uptime.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: uptime.1,v 1.5 1999/07/09 13:35:30 aaron Exp $
+.\" $OpenBSD: uptime.1,v 1.6 1999/08/12 19:26:39 millert Exp $
.\"
.\" Copyright (c) 1980, 1990, 1993, 1994
.\" The Regents of the University of California. All rights reserved.
@@ -33,7 +33,7 @@
.\"
.\" @(#)uptime.1 8.2 (Berkeley) 4/18/94
.\"
-.Dd April 18, 1994
+.Dd August 12, 1999
.Dt UPTIME 1
.Os
.Sh NAME
@@ -41,18 +41,31 @@
.Nd show how long system has been running
.Sh SYNOPSIS
.Nm uptime
+.Op Fl M Ar core
+.Op Fl N Ar system
.Sh DESCRIPTION
The
.Nm uptime
utility displays the current time,
the length of time the system has been up,
the number of users, and the load average of the system over the last
-1, 5, and 15 minutes.
-.Sh FILES
-.Bl -tag -width /bsd
-.It Pa /bsd
-system name list
-.El
+1, 5, and 15 minutes. This is the
+.Dq heading
+information from
+.Xr w 1 .
+.Pp
+The options are as follows:
+.Bl -tag -width XXXXXXXXX
+.It Fl M Ar core
+Extract values associated with the name list from the specified
+.Ar core
+instead of the default
+.Pa /dev/kmem .
+.It Fl N Ar system
+Extract the name list from the specified
+.Ar system
+instead of the default
+.Pa /bsd .
.Sh SEE ALSO
.Xr w 1
.Sh HISTORY
diff --git a/usr.bin/w/w.1 b/usr.bin/w/w.1
index b4787e10872..dce464ca180 100644
--- a/usr.bin/w/w.1
+++ b/usr.bin/w/w.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: w.1,v 1.8 1999/06/05 01:21:50 aaron Exp $
+.\" $OpenBSD: w.1,v 1.9 1999/08/12 19:26:39 millert Exp $
.\"
.\" Copyright (c) 1980, 1990, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -62,18 +62,20 @@ logged on, the time since the user last typed anything,
and the name and arguments of the current process.
.Pp
The options are as follows:
-.Bl -tag -width Ds
+.Bl -tag -width XXXXXXXXX
.It Fl h
Suppress the heading.
.It Fl i
Output is sorted by idle time.
-.It Fl M
+.It Fl M Ar core
Extract values associated with the name list from the specified
-core instead of the default
+.Ar core
+instead of the default
.Pa /dev/kmem .
-.It Fl N
-Extract the name list from the specified system instead of the
-default
+.It Fl N Ar system
+Extract the name list from the specified
+.Ar system
+instead of the default
.Pa /bsd .
.It Fl a
Attempt to translate network addresses into names.
diff --git a/usr.bin/w/w.c b/usr.bin/w/w.c
index 5c8f4252d56..8c94c4e9852 100644
--- a/usr.bin/w/w.c
+++ b/usr.bin/w/w.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: w.c,v 1.27 1999/06/05 17:04:59 deraadt Exp $ */
+/* $OpenBSD: w.c,v 1.28 1999/08/12 19:26:39 millert Exp $ */
/*-
* Copyright (c) 1980, 1991, 1993, 1994
@@ -43,7 +43,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)w.c 8.4 (Berkeley) 4/16/94";
#else
-static char *rcsid = "$OpenBSD: w.c,v 1.27 1999/06/05 17:04:59 deraadt Exp $";
+static char *rcsid = "$OpenBSD: w.c,v 1.28 1999/08/12 19:26:39 millert Exp $";
#endif
#endif /* not lint */
@@ -141,7 +141,7 @@ main(argc, argv)
p = "hiflM:N:asuw";
} else if (!strcmp(p, "uptime")) {
wcmd = 0;
- p = "";
+ p = "M:N:";
} else
errx(1,
"this program should be invoked only as \"w\" or \"uptime\"");