Dont use getopt_long, minor usage changes, patch by Nick Fedchik
authorGlenn L McGrath <bug1@ihug.co.nz>
Sun, 19 Jan 2003 13:34:21 +0000 (13:34 -0000)
committerGlenn L McGrath <bug1@ihug.co.nz>
Sun, 19 Jan 2003 13:34:21 +0000 (13:34 -0000)
include/usage.h
networking/nameif.c

index aaac7dfd90a39ce0035176dfb18b636a8895c1e1..e5aad2f4f1c9f57fabe39773d83ee3e8b5b10124 100644 (file)
        "$ mv /tmp/foo /bin/bar\n" 
 
 #define nameif_trivial_usage \
-       "[OPTIONS] [{IFNAME MACADDR}]"
+       "[-s] [-c FILE] [{IFNAME MACADDR}]"
 #define nameif_full_usage \
                "Nameif renaming network interface while it in the down state.\n\n" \
                "Options:\n" \
-               "\t-c FILE\t\tUse another configuration file (default is /etc/mactab)\n" \
+               "\t-c FILE\t\tUse configuration file (default is /etc/mactab)\n" \
                "\t-s\t\tUse syslog (LOCAL0 facility).\n" \
                "\tIFNAME MACADDR\tnew_interface_name interface_mac_address\n" 
 #define nameif_example_usage \
index cd18b4c18d2f8f4b0a86614c4cec193130f2337c..f3b9271584373b2ed1bdfa2e363d36d1528a171f 100644 (file)
@@ -36,7 +36,7 @@
 #include "busybox.h"
 
 /* take from linux/sockios.h */
-#define SIOCSIFNAME    0x8923          /* set interface name */
+#define SIOCSIFNAME    0x8923  /* set interface name */
 
 /* Octets in one ethernet addr, from <linux/if_ether.h> */
 #define ETH_ALEN       6
@@ -101,13 +101,8 @@ int nameif_main(int argc, char **argv)
        int if_index = 1;
        mactable_t *ch;
 
-       static struct option opts[] = {
-               {"syslog", 0, NULL, 's'},
-               {"configfile", 1, NULL, 'c'},
-               {NULL},
-       };
 
-       while ((opt = getopt_long(argc, argv, "c:s", opts, NULL)) != -1) {
+       while ((opt = getopt(argc, argv, "c:s")) != -1) {
                switch (opt) {
                case 'c':
                        fname = optarg;
@@ -152,8 +147,7 @@ int nameif_main(int argc, char **argv)
                        ch = xcalloc(1, sizeof(mactable_t));
                        ch->ifname = xstrndup(line_ptr, name_length);
                        if (name_length > IF_NAMESIZE)
-                           serror("interface name `%s' too long",
-                                          ch->ifname);
+                               serror("interface name `%s' too long", ch->ifname);
                        line_ptr += name_length;
                        line_ptr += strspn(line_ptr, " \t");
                        name_length = strspn(line_ptr, "0123456789ABCDEFabcdef:");