summaryrefslogtreecommitdiff
path: root/usr/src/cmd/sa
diff options
context:
space:
mode:
authoresaxe <none@none>2008-02-14 12:01:40 -0800
committeresaxe <none@none>2008-02-14 12:01:40 -0800
commit24292ef779c1060fa735368b7a0855a422f6eab8 (patch)
treed85a99cee89a44e65d8622976cce3cfc9f0b4223 /usr/src/cmd/sa
parent804cf79f354e9299a8119bd3021c9ee63abdec26 (diff)
downloadillumos-joyent-24292ef779c1060fa735368b7a0855a422f6eab8.tar.gz
6573754 timex error message when you forget a command is cryptic
Contributed by Avinash Joshi <avinashtjoshi@gmail.com>
Diffstat (limited to 'usr/src/cmd/sa')
-rw-r--r--usr/src/cmd/sa/timex.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/usr/src/cmd/sa/timex.c b/usr/src/cmd/sa/timex.c
index fe149ef808..b1a14da0bd 100644
--- a/usr/src/cmd/sa/timex.c
+++ b/usr/src/cmd/sa/timex.c
@@ -19,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -52,7 +52,7 @@ static int nsec_per_tick;
void printt(char *, hrtime_t);
void hmstime(char[]);
-void diag(char *);
+void usage();
int
main(int argc, char **argv)
@@ -93,10 +93,13 @@ main(int argc, char **argv)
case 'r': strcat(aopt, "-r "); break;
case 't': strcat(aopt, "-t "); break;
- case '?': diag("Usage: timex [-s][-o][-p[-fhkmrt]] cmd");
+ case '?': usage();
break;
}
- if (optind >= argc) diag("Missing command");
+ if (optind >= argc) {
+ fprintf(stderr, "timex: Missing command\n");
+ usage();
+ }
/*
* Check to see if accounting is installed and print a somewhat
@@ -270,9 +273,9 @@ hmstime(char stime[])
}
void
-diag(char *s)
+usage()
{
- fprintf(stderr, "%s\n", s);
+ fprintf(stderr, "Usage: timex [-o] [-p [-fhkmrt]] [-s] command\n");
unlink(fname);
exit(EXIT_FAILURE);
}