Use busybox's show_usage function for help
authorGlenn L McGrath <bug1@ihug.co.nz>
Sun, 15 Sep 2002 17:20:45 +0000 (17:20 -0000)
committerGlenn L McGrath <bug1@ihug.co.nz>
Sun, 15 Sep 2002 17:20:45 +0000 (17:20 -0000)
include/usage.h
networking/udhcpc.c

index 12289ad5b2c4aab74e2f0b7ee7059e1f60c30341..9e16a085fe9ca83a9e080d319626f586b6dbcf67 100644 (file)
 #define udhcpc_trivial_usage \
        "[-fqv] [-c CLIENTID] [-H HOSTNAME] [-i INTERFACE]\n[-p file] [-r IP] [-s script]"
 #define udhcpc_full_usage \
+       "\tUsage: udhcpcd [OPTIONS]\n" \
        "\t-c,\t--clientid=CLIENTID\tClient identifier\n" \
        "\t-H,\t--hostname=HOSTNAME\tClient hostname\n" \
        "\t-f,\t--foreground\tDo not fork after getting lease\n" \
index e2ba46bab12c61bd5e329889b29d37c59c4a5169..c05ca455765b973d9ed94c2ab664ee5ccbba2e95 100644 (file)
@@ -1254,7 +1254,7 @@ int udhcpc_main(int argc, char *argv[])
        while (1) {
                int option_index = 0;
 
-               c = getopt_long(argc, argv, "c:fH:hi:np:qr:s:v", l_options,
+               c = getopt_long(argc, argv, "c:fH:i:np:qr:s:v", l_options,
                                                &option_index);
                if (c == -1) {
                        break;
@@ -1291,21 +1291,6 @@ int udhcpc_main(int argc, char *argv[])
                        client_config.hostname[OPT_LEN] = len;
                        strncpy(client_config.hostname + 2, optarg, len);
                        break;
-               case 'h':
-                       puts("Usage: udhcpcd [OPTIONS]\n\n"
-                                "  -c, --clientid=CLIENTID         Client identifier\n"
-                                "  -H, --hostname=HOSTNAME         Client hostname\n"
-                                "  -f, --foreground                Do not fork after getting lease\n"
-                                "  -i, --interface=INTERFACE       Interface to use (default: eth0)\n"
-                                "  -n, --now                       Exit with failure if lease cannot be\n"
-                                "                                  immediately negotiated.\n"
-                                "  -p, --pidfile=file              Store process ID of daemon in file\n"
-                                "  -q, --quit                      Quit after obtaining lease\n"
-                                "  -r, --request=IP                IP address to request (default: none)\n"
-                                "  -s, --script=file               Run file at dhcp events (default:\n"
-                                "                                  " DEFAULT_SCRIPT ")\n"
-                                "  -v, --version                   Display version");
-                       return 0;
                case 'i':
                        client_config.interface = optarg;
                        break;
@@ -1328,6 +1313,8 @@ int udhcpc_main(int argc, char *argv[])
                        printf("udhcpcd, version %s\n\n", VERSION);
                        exit_client(0);
                        break;
+               default:
+                       show_usage();
                }
        }