diff options
author | Chris Cappuccio <chris@cvs.openbsd.org> | 2000-10-13 19:27:12 +0000 |
---|---|---|
committer | Chris Cappuccio <chris@cvs.openbsd.org> | 2000-10-13 19:27:12 +0000 |
commit | 029760178f305eba4ebea5d96e1e56b070d66466 (patch) | |
tree | 1f72bc9e12218af7fb79fe2d27bf44a38e34fbd5 | |
parent | eb4834c07ea1bb732dedc2575cfcaee1a2dfa142 (diff) |
Make the arguments more compatible with wi/ancontrol
Now the interface is specified as the first argument instead of with -i
-rw-r--r-- | sbin/lmccontrol/lmccontrol.8 | 10 | ||||
-rw-r--r-- | sbin/lmccontrol/lmccontrol.c | 38 |
2 files changed, 24 insertions, 24 deletions
diff --git a/sbin/lmccontrol/lmccontrol.8 b/sbin/lmccontrol/lmccontrol.8 index d478eb2efab..296bae2413d 100644 --- a/sbin/lmccontrol/lmccontrol.8 +++ b/sbin/lmccontrol/lmccontrol.8 @@ -1,4 +1,4 @@ -.\" $OpenBSD: lmccontrol.8,v 1.2 2000/10/13 19:11:34 aaron Exp $ +.\" $OpenBSD: lmccontrol.8,v 1.3 2000/10/13 19:27:10 chris Exp $ .\" .\" Copyright (c) 1997-1999 LAN Media Corporation (LMC) .\" All rights reserved. www.lanmedia.com @@ -42,7 +42,7 @@ .Nd configure Lan Media Corporation SSI/HSSI/T1/T3 devices .Sh SYNOPSIS .Nm lmcctl -.Op Fl i Ar interface +.Op Ar interface .Op Fl l Ar speed .Op Fl cCeEsSkKoO .Sh DESCRIPTION @@ -69,7 +69,7 @@ The T1 card is the LMC1200 and runs at a speed of 1.544Mbps or 2Mbps for E1 operation, without CSU/DSU. .Pp The -.Op Fl i Ar iface +.Op Ar interface argument given to .Nm should be the logical interface name associated with the Lan Media @@ -83,7 +83,7 @@ settings from the driver and prints them out. The options are as follows: .Pp .Bl -tag -width Fl -.It Fl i Ar interface +.It Ar interface The interface name of the Lan Media card (default is lmc0) .It Fl l Ar speed To manually specify line speed, in bits per second (for devices without built-in CSU/DSU) @@ -122,7 +122,7 @@ power). To set a SSI card for a speed of 2048000 bits/sec with HDLC keepalive off, one could use: .Bd -unfilled -offset indent -lmcctl -i lmc0 -l 2048000 -K +lmcctl lmc0 -l 2048000 -K .Ed .Pp .Sh SEE ALSO diff --git a/sbin/lmccontrol/lmccontrol.c b/sbin/lmccontrol/lmccontrol.c index e9f97029c4a..85977b02d0c 100644 --- a/sbin/lmccontrol/lmccontrol.c +++ b/sbin/lmccontrol/lmccontrol.c @@ -1,5 +1,4 @@ -/* $OpenBSD: lmccontrol.c,v 1.1 2000/10/13 16:22:08 chris Exp $ */ -/* $Id: lmccontrol.c,v 1.1 2000/10/13 16:22:08 chris Exp $ */ +/* $OpenBSD: lmccontrol.c,v 1.2 2000/10/13 19:27:11 chris Exp $ */ /*- * Copyright (c) 1997-1999 LAN Media Corporation (LMC) @@ -67,7 +66,7 @@ void usage(char *s) { fprintf(stderr, - "usage: lmccontrol [-i interface] [-l speed] [-cCeEsKkSoO]\n"); + "usage: lmccontrol [interface] [-l speed] [-cCeEsSkKoO]\n"); } int @@ -79,26 +78,27 @@ main(int argc, char **argv) int ch; char *ifname = DEFAULT_INTERFACE; lmc_ctl_t wanted; - int flag_c; /* clock source external, internal */ - int flag_l; /* line speed */ - int flag_s; /* Scrambler on, off */ - int flag_o; /* cable length < 100, > 100 */ - int flag_e; /* crc 16, 32 */ - int flag_k; /* HDLC keepalive */ - int just_print; - - flag_c = 0; - flag_l = 0; - flag_s = 0; - flag_o = 0; - flag_e = 0; - flag_k = 0; - just_print = 1; + int flag_c = 0; /* clock source external, internal */ + int flag_l = 0; /* line speed */ + int flag_s = 0; /* Scrambler on, off */ + int flag_o = 0; /* cable length < 100, > 100 */ + int flag_e = 0; /* crc 16, 32 */ + int flag_k = 0; /* HDLC keepalive */ + int just_print = 1; + int ifspecified = 0; + + if (argc > 1 && argv[1][0] != '-') { + ifname = argv[1]; + memcpy(&argv[1], &argv[2], argc * sizeof(char *)); + argc--; + ifspecified = 1; + } while ((ch = getopt(argc, argv, "i:l:cCsSoOeEkKpP")) != -1) { switch (ch) { case 'i': - ifname = optarg; + if (!ifspecified) + ifname = optarg; break; case 'l': flag_l = 1; |