aboutsummaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorDiomidis Spinellis <dds@FreeBSD.org>2007-04-18 16:43:21 +0000
committerDiomidis Spinellis <dds@FreeBSD.org>2007-04-18 16:43:21 +0000
commitb7dd80b84386aaa92747d1c464356350e76dd5a8 (patch)
tree25cb87da1939ba4c0b32edc9813f229526075062 /usr.bin
parent32371d20251dad292cdda0bd71858df2df82b203 (diff)
downloadsrc-b7dd80b84386aaa92747d1c464356350e76dd5a8.tar.gz
src-b7dd80b84386aaa92747d1c464356350e76dd5a8.zip
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
Notes
Notes: svn path=/head/; revision=168841
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/lastcomm/lastcomm.16
-rw-r--r--usr.bin/lastcomm/lastcomm.c24
2 files changed, 15 insertions, 15 deletions
diff --git a/usr.bin/lastcomm/lastcomm.1 b/usr.bin/lastcomm/lastcomm.1
index 22a37d22def0..b29d0ba889e5 100644
--- a/usr.bin/lastcomm/lastcomm.1
+++ b/usr.bin/lastcomm/lastcomm.1
@@ -43,7 +43,7 @@
.Oo
.Op Fl EScesu
|
-.Op Fl w
+.Op Fl X
.Oc
.Op Fl f Ar file
.Op Ar command ...\&
@@ -72,8 +72,8 @@ Print the amount of elapsed time used by the process.
Print the amount of system time used by the process.
.It Fl u
Print the amount of user time used by the process.
-.It Fl w
-Write out the complete contents of each accounting record in a text format
+.It Fl X
+Export the complete contents of each accounting record in a text format
that can be parsed by programs.
The elements are written in the order defined in
.Xr acct 5 .
diff --git a/usr.bin/lastcomm/lastcomm.c b/usr.bin/lastcomm/lastcomm.c
index 9d515376e778..386f94fd5096 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,