Sort options.

ok wiz@
This commit is contained in:
peter 2004-11-22 17:20:02 +00:00
parent e345d25606
commit 1a4cb94e52
2 changed files with 11 additions and 11 deletions

View File

@ -1,4 +1,4 @@
.\" $NetBSD: who.1,v 1.14 2003/08/07 11:17:18 agc Exp $ .\" $NetBSD: who.1,v 1.15 2004/11/22 17:20:02 peter Exp $
.\" .\"
.\" Copyright (c) 1986, 1991, 1993 .\" Copyright (c) 1986, 1991, 1993
.\" The Regents of the University of California. All rights reserved. .\" The Regents of the University of California. All rights reserved.
@ -37,7 +37,7 @@
.Nd display who is logged in .Nd display who is logged in
.Sh SYNOPSIS .Sh SYNOPSIS
.Nm .Nm
.Op Fl mTuH .Op Fl HmTu
.Op Ar file .Op Ar file
.Nm .Nm
.Ar am i .Ar am i
@ -51,6 +51,8 @@ hostname if not local.
Available options: Available options:
.Pp .Pp
.Bl -tag -width file .Bl -tag -width file
.It Fl H
Write column headings above the regular output.
.It Fl m .It Fl m
Only print information about the current terminal. Only print information about the current terminal.
This is the This is the
@ -70,8 +72,6 @@ and
if a bad line is encountered. if a bad line is encountered.
.It Fl u .It Fl u
Print the idle time for each user. Print the idle time for each user.
.It Fl H
Write column headings above the regular output.
.It Ar \&am I .It Ar \&am I
Returns the invoker's real user name. Returns the invoker's real user name.
.It Ar file .It Ar file

View File

@ -1,4 +1,4 @@
/* $NetBSD: who.c,v 1.13 2004/01/05 23:23:37 jmmv Exp $ */ /* $NetBSD: who.c,v 1.14 2004/11/22 17:20:02 peter Exp $ */
/* /*
* Copyright (c) 1989, 1993 * Copyright (c) 1989, 1993
@ -43,7 +43,7 @@ __COPYRIGHT(
#if 0 #if 0
static char sccsid[] = "@(#)who.c 8.1 (Berkeley) 6/6/93"; static char sccsid[] = "@(#)who.c 8.1 (Berkeley) 6/6/93";
#endif #endif
__RCSID("$NetBSD: who.c,v 1.13 2004/01/05 23:23:37 jmmv Exp $"); __RCSID("$NetBSD: who.c,v 1.14 2004/11/22 17:20:02 peter Exp $");
#endif /* not lint */ #endif /* not lint */
#include <sys/types.h> #include <sys/types.h>
@ -79,8 +79,11 @@ main(int argc, char **argv)
setlocale(LC_ALL, ""); setlocale(LC_ALL, "");
only_current_term = show_term = show_idle = show_labels = 0; only_current_term = show_term = show_idle = show_labels = 0;
while ((c = getopt(argc, argv, "mTuH")) != -1) { while ((c = getopt(argc, argv, "HmTu")) != -1) {
switch (c) { switch (c) {
case 'H':
show_labels = 1;
break;
case 'm': case 'm':
only_current_term = 1; only_current_term = 1;
break; break;
@ -90,9 +93,6 @@ main(int argc, char **argv)
case 'u': case 'u':
show_idle = 1; show_idle = 1;
break; break;
case 'H':
show_labels = 1;
break;
default: default:
usage(); usage();
/* NOTREACHED */ /* NOTREACHED */
@ -246,7 +246,7 @@ output_labels()
static void static void
usage() usage()
{ {
(void)fprintf(stderr, "usage: %s [-mTuH] [ file ]\n %s am i\n", (void)fprintf(stderr, "usage: %s [-HmTu] [file]\n %s am i\n",
getprogname(), getprogname()); getprogname(), getprogname());
exit(1); exit(1);
} }