diff options
author | phk <phk@FreeBSD.org> | 2001-05-29 09:13:44 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2001-05-29 09:13:44 +0000 |
commit | de9bff5d04a6648d18315758ba3fc3c56bef1f05 (patch) | |
tree | 03e1c73f9af3dbf790af67ceca6eb7b4e7f06af2 /sbin/ifconfig/ifconfig.c | |
parent | b7bd9d6b28334d79ebd3b8ca19c21cf54a4e5c21 (diff) | |
download | FreeBSD-src-de9bff5d04a6648d18315758ba3fc3c56bef1f05.zip FreeBSD-src-de9bff5d04a6648d18315758ba3fc3c56bef1f05.tar.gz |
When using interfaces that support if_media, the supported media list is
printed on a single, very long, and generally unreadable line. This
isn't very useful. It's also really ugly and most of the time you don't
care what media is supported anyway.
PR: 27701
Submitted by: Brooks Davis <brooks@one-eyed-alien.net>
Diffstat (limited to 'sbin/ifconfig/ifconfig.c')
-rw-r--r-- | sbin/ifconfig/ifconfig.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c index 858221d..f865af24 100644 --- a/sbin/ifconfig/ifconfig.c +++ b/sbin/ifconfig/ifconfig.c @@ -134,6 +134,8 @@ static int ip6lifetime; struct afswtch; +int supmedia = 0; + #ifdef INET6 char addr_buf[MAXHOSTNAMELEN *2 + 1]; /*for getnameinfo()*/ #endif @@ -351,16 +353,16 @@ usage() fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n", "usage: ifconfig interface address_family [address [dest_address]]", " [parameters]", - " ifconfig -a [-d] [-u] [address_family]", + " ifconfig -a [-d] [-m] [-u] [address_family]", " ifconfig -l [-d] [-u] [address_family]", - " ifconfig [-d] [-u]"); + " ifconfig [-d] [-m] [-u]"); #else fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n", "usage: ifconfig [-L] interface address_family [address [dest_address]]", " [parameters]", - " ifconfig -a [-L] [-d] [-u] [address_family]", + " ifconfig -a [-L] [-d] [-m] [-u] [address_family]", " ifconfig -l [-d] [-u] [address_family]", - " ifconfig [-L] [-d] [-u]"); + " ifconfig [-L] [-d] [-m] [-u]"); #endif exit(1); } @@ -410,7 +412,7 @@ main(argc, argv) uponly++; break; case 'm': /* show media choices in status */ - /* ignored for compatibility */ + supmedia = 1; break; default: usage(); @@ -421,7 +423,7 @@ main(argc, argv) argv += optind; /* -l cannot be used with -a or -m */ - if (namesonly && all) + if (namesonly && (all || supmedia)) usage(); /* nonsense.. */ |