diff options
author | dds <dds@FreeBSD.org> | 2007-04-18 16:43:21 +0000 |
---|---|---|
committer | dds <dds@FreeBSD.org> | 2007-04-18 16:43:21 +0000 |
commit | 208b8c0f119fde468ea5bc9342f64b60b49bc236 (patch) | |
tree | 25cb87da1939ba4c0b32edc9813f229526075062 /usr.bin/lastcomm/lastcomm.c | |
parent | 65e2222ba480c2ef86655e2a0c17548c5bb6d107 (diff) | |
download | FreeBSD-src-208b8c0f119fde468ea5bc9342f64b60b49bc236.zip FreeBSD-src-208b8c0f119fde468ea5bc9342f64b60b49bc236.tar.gz |
Change the export option from -w (write) to -X.
While implementing import it became apparent that write as a mnemonic
is ambiguous and confusing.
MFC after: 8 days
Diffstat (limited to 'usr.bin/lastcomm/lastcomm.c')
-rw-r--r-- | usr.bin/lastcomm/lastcomm.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/usr.bin/lastcomm/lastcomm.c b/usr.bin/lastcomm/lastcomm.c index 9d51537..386f94f 100644 --- a/usr.bin/lastcomm/lastcomm.c +++ b/usr.bin/lastcomm/lastcomm.c @@ -68,7 +68,7 @@ char *flagbits(int); const char *getdev(dev_t); int requested(char *[], struct acct *); static void usage(void); -static void write_record(struct acct *acp); +static void export_record(struct acct *acp); #define AC_UTIME 1 /* user */ #define AC_STIME 2 /* system */ @@ -92,10 +92,10 @@ main(int argc, char *argv[]) int ch; const char *acctfile; int flags = 0; - bool write_text = false; + bool export_text = false; acctfile = _PATH_ACCT; - while ((ch = getopt(argc, argv, "f:uwsecSE")) != -1) + while ((ch = getopt(argc, argv, "f:usecSEX")) != -1) switch((char)ch) { case 'f': acctfile = optarg; @@ -103,8 +103,8 @@ main(int argc, char *argv[]) case 'u': flags |= AC_UTIME; /* user time */ break; - case 'w': - write_text = true; /* export */ + case 'X': + export_text = true; /* export */ break; case 's': flags |= AC_STIME; /* system time */ @@ -130,10 +130,10 @@ main(int argc, char *argv[]) } /* default user + system time and starting time */ - if (!flags && !write_text) + if (!flags && !export_text) flags = AC_CTIME | AC_BTIME; - if (flags && write_text) + if (flags && export_text) usage(); argc -= optind; @@ -161,7 +161,7 @@ main(int argc, char *argv[]) do { int rv; - if (fp != stdin && !write_text) { + if (fp != stdin && !export_text) { size -= sizeof(struct acct); if (fseeko(fp, size, SEEK_SET) == -1) err(1, "seek %s failed", acctfile); @@ -185,8 +185,8 @@ main(int argc, char *argv[]) if (*argv && !requested(argv, &ab)) continue; - if (write_text) { - write_record(&ab); + if (export_text) { + export_record(&ab); continue; } @@ -307,12 +307,12 @@ static void usage(void) { (void)fprintf(stderr, -"usage: lastcomm [[-EScesu] | [-w]] [-f file] [command ...] [user ...] [terminal ...]\n"); +"usage: lastcomm [[-EScesu] | [-X]] [-f file] [command ...] [user ...] [terminal ...]\n"); exit(1); } static void -write_record(struct acct *acp) +export_record(struct acct *acp) { (void)printf("%s %g %g %g", acp->ac_comm, |