summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>2002-01-02 19:18:56 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>2002-01-02 19:18:56 +0000
commit1f66a61057d0f5e31d3b268f91d35b3e4fc75e40 (patch)
treed8e18726bc00ebc8cb882b7a7571c22b88a26c28
parentf9a0c10ad1f5c5718abf3b96700c701c39600d1d (diff)
make usage() exit(1) and look like sysctl(8), getopt returns int
-rw-r--r--usr.bin/radioctl/radioctl.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/usr.bin/radioctl/radioctl.c b/usr.bin/radioctl/radioctl.c
index 97ffaf8f92c..b513e02bde9 100644
--- a/usr.bin/radioctl/radioctl.c
+++ b/usr.bin/radioctl/radioctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: radioctl.c,v 1.6 2002/01/01 22:03:49 deraadt Exp $ */
+/* $OpenBSD: radioctl.c,v 1.7 2002/01/02 19:18:55 mickey Exp $ */
/* $RuOBSD: radioctl.c,v 1.4 2001/10/20 18:09:10 pva Exp $ */
/*
@@ -109,7 +109,7 @@ main(int argc, char **argv)
char *radiodev = NULL;
int rd = -1;
- char optchar;
+ int optchar;
char *param = NULL;
int show_vars = 0;
@@ -118,10 +118,8 @@ main(int argc, char **argv)
int optv = 0;
- if (argc < 2) {
+ if (argc < 2)
usage();
- exit(1);
- }
radiodev = getenv(RADIO_ENV);
if (radiodev == NULL)
@@ -186,8 +184,11 @@ main(int argc, char **argv)
static void
usage(void)
{
- printf("Usage: %s [-f file] [-a] [-n] [-w name=value] [name]\n",
- __progname);
+ fprintf(stderr, "usage: %s [-f file] [-n] variable ...\n"
+ " %s [-f file] [-n] -w variable=value ...\n"
+ " %s [-f file] [-n] -a\n",
+ __progname, __progname, __progname);
+ exit(1);
}
static void