Subject: Re: Automatically bumping device numbers
To: Zafer Aydogan <zafer.aydogan@gmail.com>
From: Jeremy C. Reed <reed@reedmedia.net>
List: current-users
Date: 03/24/2006 16:32:16
On Sat, 25 Mar 2006, Zafer Aydogan wrote:
> /* no arguments is equivalent to '-a' */
> if (!namesonly && argc < 1)
> all = 1;
Or diff for netbsd-2:
Index: sbin/ifconfig/ifconfig.8
===================================================================
RCS file: /cvsroot/src/sbin/ifconfig/ifconfig.8,v
retrieving revision 1.72
diff -b -u -r1.72 ifconfig.8
--- sbin/ifconfig/ifconfig.8 1 Mar 2004 00:19:06 -0000 1.72
+++ sbin/ifconfig/ifconfig.8 25 Mar 2006 00:28:53 -0000
@@ -594,6 +594,9 @@
limits this to broadcast interfaces, and
.Fl s
omits interfaces which appear not to be connected to a network.
+When no arguments are given,
+.Fl a
+is implied.
.Pp
The
.Fl l
Index: sbin/ifconfig/ifconfig.c
===================================================================
RCS file: /cvsroot/src/sbin/ifconfig/ifconfig.c,v
retrieving revision 1.141.4.2
diff -b -u -r1.141.4.2 ifconfig.c
--- sbin/ifconfig/ifconfig.c 24 Jul 2005 01:58:38 -0000 1.141.4.2
+++ sbin/ifconfig/ifconfig.c 25 Mar 2006 00:28:58 -0000
@@ -408,8 +408,16 @@
{
int ch;
- /* Parse command-line options */
aflag = mflag = vflag = zflag = 0;
+
+ /* When no arguments are given, -a is implied. */
+ if (argc < 2) {
+ af = ifr.ifr_addr.sa_family = afs[0].af_af;
+ printall(NULL);
+ exit(0);
+ }
+
+ /* Parse command-line options */
while ((ch = getopt(argc, argv, "AabCdlmsuvz"
#ifdef INET6
"L"
Jeremy C. Reed
echo ':6DB6=88>?;@69876tA=AC8BB5tA6487><' | tr '4-F' 'wu rofIn.lkigemca'