summaryrefslogtreecommitdiffstats
path: root/usr.bin/finger/finger.c
diff options
context:
space:
mode:
authorpst <pst@FreeBSD.org>1994-09-07 07:22:41 +0000
committerpst <pst@FreeBSD.org>1994-09-07 07:22:41 +0000
commit72c244e5533a91ef34a3fac2404611a46ee6874a (patch)
treeef10cc8b732e94b450f8199f8c72cfd130652b5a /usr.bin/finger/finger.c
parent62391009757751f11deb63fb9ed07fab5976c86c (diff)
downloadFreeBSD-src-72c244e5533a91ef34a3fac2404611a46ee6874a.zip
FreeBSD-src-72c244e5533a91ef34a3fac2404611a46ee6874a.tar.gz
Install Luke's enhancements for finger.
By default, behave like the old ugly 4.4bsd finger and print office information instead of remote login information. It's an easy one line fix to make it behave like most other vendor's fingers if we decide to change the default. Reviewed by: pst
Diffstat (limited to 'usr.bin/finger/finger.c')
-rw-r--r--usr.bin/finger/finger.c32
1 files changed, 26 insertions, 6 deletions
diff --git a/usr.bin/finger/finger.c b/usr.bin/finger/finger.c
index 5a16765..aaef07b 100644
--- a/usr.bin/finger/finger.c
+++ b/usr.bin/finger/finger.c
@@ -34,6 +34,16 @@
* SUCH DAMAGE.
*/
+/*
+ * Luke Mewburn <lm@rmit.edu.au> added the following on 940622:
+ * - mail status ("No Mail", "Mail read:...", or "New Mail ...,
+ * Unread since ...".)
+ * - 4 digit phone extensions (3210 is printed as x3210.)
+ * - host/office toggling in short format with -h & -o.
+ * - short day names (`Tue' printed instead of `Jun 21' if the
+ * login time is < 6 days.
+ */
+
#ifndef lint
static char copyright[] =
"@(#) Copyright (c) 1989, 1993\n\
@@ -52,9 +62,10 @@ static char sccsid[] = "@(#)finger.c 8.2 (Berkeley) 9/30/93";
*
* There are currently two output formats; the short format is one line
* per user and displays login name, tty, login time, real name, idle time,
- * and office location/phone number. The long format gives the same
- * information (in a more legible format) as well as home directory, shell,
- * mail info, and .plan/.project files.
+ * and either remote host information (default) or office location/phone
+ * number, depending on if -h or -o is used respectively.
+ * The long format gives the same information (in a more legible format) as
+ * well as home directory, shell, mail info, and .plan/.project files.
*/
#include <sys/param.h>
@@ -71,7 +82,7 @@ static char sccsid[] = "@(#)finger.c 8.2 (Berkeley) 9/30/93";
DB *db;
time_t now;
-int entries, lflag, mflag, pplan, sflag;
+int entries, lflag, mflag, pplan, sflag, oflag;
char tbuf[1024];
static void loginlist __P((void));
@@ -83,7 +94,10 @@ main(argc, argv)
{
int ch;
- while ((ch = getopt(argc, argv, "lmps")) != EOF)
+ /* delete this for sun behavior */
+ oflag = 1; /* default to old behavior for now */
+
+ while ((ch = getopt(argc, argv, "lmpsho")) != EOF)
switch(ch) {
case 'l':
lflag = 1; /* long format */
@@ -97,10 +111,16 @@ main(argc, argv)
case 's':
sflag = 1; /* short format */
break;
+ case 'h':
+ oflag = 0; /* remote host info */
+ break;
+ case 'o':
+ oflag = 1; /* office info */
+ break;
case '?':
default:
(void)fprintf(stderr,
- "usage: finger [-lmps] [login ...]\n");
+ "usage: finger [-lmpsho] [login ...]\n");
exit(1);
}
argc -= optind;
OpenPOWER on IntegriCloud