Deprecate the -l option in favour of more natural -W.

The compatibility glue is still provided.

(This change is not yet reflected in the manpage, nor
in usage().  This will be fixed at a later time today,
with the general manpage cleanup commit.)
This commit is contained in:
Ruslan Ermilov 2001-09-07 12:00:50 +00:00
parent fb5d0fbdd7
commit 70057abf2d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=83200
5 changed files with 11 additions and 15 deletions

View File

@ -1049,7 +1049,7 @@ inet6print(struct in6_addr *in6, int port, char *proto, int numeric)
char line[80], *cp;
int width;
sprintf(line, "%.*s.", lflag ? 39 :
sprintf(line, "%.*s.", Wflag ? 39 :
(Aflag && !numeric) ? 12 : 16, inet6name(in6));
cp = index(line, '\0');
if (!numeric && port)
@ -1058,7 +1058,7 @@ inet6print(struct in6_addr *in6, int port, char *proto, int numeric)
sprintf(cp, "%.8s", sp ? sp->s_name : "*");
else
sprintf(cp, "%d", ntohs((u_short)port));
width = lflag ? 45 : Aflag ? 18 : 22;
width = Wflag ? 45 : Aflag ? 18 : 22;
printf("%-*.*s ", width, width, line);
}

View File

@ -322,7 +322,6 @@ int bflag; /* show i/f total bytes in/out */
int dflag; /* show i/f dropped packets */
int gflag; /* show group (multicast) routing or stats */
int iflag; /* show interfaces */
int lflag; /* show routing table with use and ref */
int Lflag; /* show size of listen queues */
int mflag; /* show memory stats */
int numeric_addr; /* show addresses numerically */
@ -413,9 +412,6 @@ main(argc, argv)
case 'i':
iflag = 1;
break;
case 'l':
lflag = 1;
break;
case 'L':
Lflag = 1;
break;
@ -455,6 +451,7 @@ main(argc, argv)
af = AF_UNIX;
break;
case 'W':
case 'l':
Wflag = 1;
break;
case 'w':

View File

@ -88,8 +88,8 @@
#include "netstat.h"
#define WID_ORG (lflag ? 39 : (numeric_addr ? 29 : 18)) /* width of origin column */
#define WID_GRP (lflag ? 18 : (numeric_addr ? 16 : 18)) /* width of group column */
#define WID_ORG (Wflag ? 39 : (numeric_addr ? 29 : 18)) /* width of origin column */
#define WID_GRP (Wflag ? 18 : (numeric_addr ? 16 : 18)) /* width of group column */
void
mroute6pr(u_long mfcaddr, u_long mifaddr)

View File

@ -42,7 +42,6 @@ extern int bflag; /* show i/f total bytes in/out */
extern int dflag; /* show i/f dropped packets */
extern int gflag; /* show group (multicast) routing or stats */
extern int iflag; /* show interfaces */
extern int lflag; /* show routing table with use and ref */
extern int Lflag; /* show size of listen queues */
extern int mflag; /* show memory stats */
extern int numeric_addr; /* show addresses numerically */

View File

@ -228,9 +228,9 @@ pr_family(int af)
#define WID_IF(af) 6 /* width of netif column */
#else
#define WID_DST(af) \
((af) == AF_INET6 ? (lflag ? 39 : (numeric_addr ? 33: 18)) : 18)
((af) == AF_INET6 ? (Wflag ? 39 : (numeric_addr ? 33: 18)) : 18)
#define WID_GW(af) \
((af) == AF_INET6 ? (lflag ? 31 : (numeric_addr ? 29 : 18)) : 18)
((af) == AF_INET6 ? (Wflag ? 31 : (numeric_addr ? 29 : 18)) : 18)
#define WID_IF(af) ((af) == AF_INET6 ? 8 : 6)
#endif /*INET6*/
@ -243,8 +243,8 @@ pr_rthdr(int af)
if (Aflag)
printf("%-8.8s ","Address");
if (af == AF_INET || lflag)
if (lflag)
if (af == AF_INET || Wflag)
if (Wflag)
printf("%-*.*s %-*.*s %-6.6s %6.6s %8.8s %6.6s %*.*s %6s\n",
WID_DST(af), WID_DST(af), "Destination",
WID_GW(af), WID_GW(af), "Gateway",
@ -602,9 +602,9 @@ p_rtentry(struct rtentry *rt)
p_sockaddr(kgetsa(rt->rt_gateway), NULL, RTF_HOST,
WID_GW(addr.u_sa.sa_family));
p_flags(rt->rt_flags, "%-6.6s ");
if (addr.u_sa.sa_family == AF_INET || lflag) {
if (addr.u_sa.sa_family == AF_INET || Wflag) {
printf("%6ld %8ld ", rt->rt_refcnt, rt->rt_use);
if (lflag) {
if (Wflag) {
if (rt->rt_rmx.rmx_mtu != 0)
printf("%6lu ", rt->rt_rmx.rmx_mtu);
else