Make '-i iface' optional. Assume an0 if it's not otherwise specified.

This commit is contained in:
Josef Karthauser 2000-10-28 23:33:28 +00:00
parent 54b93a1055
commit 59038c5722
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=67823
2 changed files with 15 additions and 5 deletions

View File

@ -105,7 +105,8 @@ The
argument given to
.Nm
should be the logical interface name associated with the Aironet
device (an0, an1, etc...).
device (an0, an1, etc...). If one isn't specified the device an0 will
be assumed.
.Sh OPTIONS
The options are as follows:
.Bl -tag -width Fl

View File

@ -1134,8 +1134,20 @@ int main(argc, argv)
void *arg = NULL;
char *p = argv[0];
/* Get the interface name */
opterr = 0;
ch = getopt(argc, argv, "i:");
if (ch == 'i') {
iface = optarg;
} else {
iface = "an0";
optreset = 1;
optind = 1;
}
opterr = 1;
while ((ch = getopt(argc, argv,
"i:ANISCTht:a:o:s:n:v:d:j:b:c:r:p:w:m:l:QZ")) != -1) {
"ANISCTht:a:o:s:n:v:d:j:b:c:r:p:w:m:l:QZ")) != -1) {
switch(ch) {
case 'Z':
#ifdef ANCACHE
@ -1151,9 +1163,6 @@ int main(argc, argv)
errx(1, "ANCACHE not available");
#endif
break;
case 'i':
iface = optarg;
break;
case 'A':
act = ACT_DUMPAP;
break;