summaryrefslogtreecommitdiffstats
path: root/usr.bin/mk_cmds
diff options
context:
space:
mode:
authorcharnier <charnier@FreeBSD.org>1997-07-24 07:00:17 +0000
committercharnier <charnier@FreeBSD.org>1997-07-24 07:00:17 +0000
commit49ace60aee5e32db794915421ae47700a0f5a5bc (patch)
treede4d71cc10e9a6a4d325b6bf8f68c32fd93b41ca /usr.bin/mk_cmds
parentf61512bf13065db14f73912536dfcfa8fe665463 (diff)
downloadFreeBSD-src-49ace60aee5e32db794915421ae47700a0f5a5bc.zip
FreeBSD-src-49ace60aee5e32db794915421ae47700a0f5a5bc.tar.gz
Add usage().
Diffstat (limited to 'usr.bin/mk_cmds')
-rw-r--r--usr.bin/mk_cmds/mk_cmds.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/usr.bin/mk_cmds/mk_cmds.c b/usr.bin/mk_cmds/mk_cmds.c
index 1c3a3fb..d3a6dbb 100644
--- a/usr.bin/mk_cmds/mk_cmds.c
+++ b/usr.bin/mk_cmds/mk_cmds.c
@@ -26,6 +26,13 @@ extern FILE *output_file;
extern FILE *yyin, *yyout;
extern int yylineno;
+static void
+usage(void)
+{
+ fprintf(stderr, "usage: mk_cmds cmdtbl.ct\n");
+ exit(1);
+}
+
int
main(argc, argv)
int argc;
@@ -35,12 +42,8 @@ main(argc, argv)
int result;
char *path, *p;
- if (argc != 2) {
- fputs("Usage: ", stderr);
- fputs(argv[0], stderr);
- fputs(" cmdtbl.ct\n", stderr);
- exit(1);
- }
+ if (argc != 2)
+ usage();
path = malloc(strlen(argv[1])+4); /* extra space to add ".ct" */
strcpy(path, argv[1]);
OpenPOWER on IntegriCloud