diff options
Diffstat (limited to 'sbin/ipwcontrol/ipwcontrol.c')
-rw-r--r-- | sbin/ipwcontrol/ipwcontrol.c | 28 |
1 files changed, 8 insertions, 20 deletions
diff --git a/sbin/ipwcontrol/ipwcontrol.c b/sbin/ipwcontrol/ipwcontrol.c index 887db67817c..21efe261c99 100644 --- a/sbin/ipwcontrol/ipwcontrol.c +++ b/sbin/ipwcontrol/ipwcontrol.c @@ -1,4 +1,4 @@ -/* $Id: ipwcontrol.c,v 1.1 2004/10/20 12:50:48 deraadt Exp $ */ +/* $Id: ipwcontrol.c,v 1.2 2004/10/20 21:01:38 deraadt Exp $ */ /*- * Copyright (c) 2004 @@ -28,7 +28,7 @@ */ #ifndef lint -static char rcsid[] = "$Id: ipwcontrol.c,v 1.1 2004/10/20 12:50:48 deraadt Exp $"; +static char rcsid[] = "$Id: ipwcontrol.c,v 1.2 2004/10/20 21:01:38 deraadt Exp $"; #endif /* not lint */ #include <sys/types.h> @@ -72,21 +72,11 @@ main(int argc, char **argv) int ch; char *iface; - opterr = 0; - ch = getopt(argc, argv, "i:"); - if (ch == 'i') { - iface = optarg; - } else { - if (argc > 1 && argv[1][0] != '-') { - iface = argv[1]; - optind = 2; - } else { - iface = "ipw0"; - optind = 1; - } - optreset = 1; + if (argc == 1) + iface = "ipw0"; + else if (argc > 1 && argv[1][0] != '-') { + iface = argv[1]; } - opterr = 1; while ((ch = getopt(argc, argv, "f:kr")) != -1) { switch (ch) { @@ -117,10 +107,8 @@ usage(void) { extern char *__progname; - (void)fprintf(stderr, "usage: %s -i iface\n" - "\t%s -i iface -f firmware\n" - "\t%s -i iface -k\n" - "\t%s -i iface -r\n", __progname, __progname, __progname, + fprintf(stderr, + "usage: %s [interface] [-i interface] [-f firmware] [-kr]\n", __progname); exit(EX_USAGE); |