aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGlenn L McGrath <bug1@ihug.co.nz>2002-09-15 17:20:45 +0000
committerGlenn L McGrath <bug1@ihug.co.nz>2002-09-15 17:20:45 +0000
commit6714862bdd2ee83d0e0f42cdbf4752629376b81e (patch)
tree58b273dec21745e31c42ce34e6b26e596987e63a
parent7a32aaacd02c7f4035b0894aced7860658703985 (diff)
downloadbusybox-w32-6714862bdd2ee83d0e0f42cdbf4752629376b81e.tar.gz
busybox-w32-6714862bdd2ee83d0e0f42cdbf4752629376b81e.tar.bz2
busybox-w32-6714862bdd2ee83d0e0f42cdbf4752629376b81e.zip
Use busybox's show_usage function for help
-rw-r--r--include/usage.h1
-rw-r--r--networking/udhcpc.c19
2 files changed, 4 insertions, 16 deletions
diff --git a/include/usage.h b/include/usage.h
index 12289ad5b..9e16a085f 100644
--- a/include/usage.h
+++ b/include/usage.h
@@ -1916,6 +1916,7 @@
1916#define udhcpc_trivial_usage \ 1916#define udhcpc_trivial_usage \
1917 "[-fqv] [-c CLIENTID] [-H HOSTNAME] [-i INTERFACE]\n[-p file] [-r IP] [-s script]" 1917 "[-fqv] [-c CLIENTID] [-H HOSTNAME] [-i INTERFACE]\n[-p file] [-r IP] [-s script]"
1918#define udhcpc_full_usage \ 1918#define udhcpc_full_usage \
1919 "\tUsage: udhcpcd [OPTIONS]\n" \
1919 "\t-c,\t--clientid=CLIENTID\tClient identifier\n" \ 1920 "\t-c,\t--clientid=CLIENTID\tClient identifier\n" \
1920 "\t-H,\t--hostname=HOSTNAME\tClient hostname\n" \ 1921 "\t-H,\t--hostname=HOSTNAME\tClient hostname\n" \
1921 "\t-f,\t--foreground\tDo not fork after getting lease\n" \ 1922 "\t-f,\t--foreground\tDo not fork after getting lease\n" \
diff --git a/networking/udhcpc.c b/networking/udhcpc.c
index e2ba46bab..c05ca4557 100644
--- a/networking/udhcpc.c
+++ b/networking/udhcpc.c
@@ -1254,7 +1254,7 @@ int udhcpc_main(int argc, char *argv[])
1254 while (1) { 1254 while (1) {
1255 int option_index = 0; 1255 int option_index = 0;
1256 1256
1257 c = getopt_long(argc, argv, "c:fH:hi:np:qr:s:v", l_options, 1257 c = getopt_long(argc, argv, "c:fH:i:np:qr:s:v", l_options,
1258 &option_index); 1258 &option_index);
1259 if (c == -1) { 1259 if (c == -1) {
1260 break; 1260 break;
@@ -1291,21 +1291,6 @@ int udhcpc_main(int argc, char *argv[])
1291 client_config.hostname[OPT_LEN] = len; 1291 client_config.hostname[OPT_LEN] = len;
1292 strncpy(client_config.hostname + 2, optarg, len); 1292 strncpy(client_config.hostname + 2, optarg, len);
1293 break; 1293 break;
1294 case 'h':
1295 puts("Usage: udhcpcd [OPTIONS]\n\n"
1296 " -c, --clientid=CLIENTID Client identifier\n"
1297 " -H, --hostname=HOSTNAME Client hostname\n"
1298 " -f, --foreground Do not fork after getting lease\n"
1299 " -i, --interface=INTERFACE Interface to use (default: eth0)\n"
1300 " -n, --now Exit with failure if lease cannot be\n"
1301 " immediately negotiated.\n"
1302 " -p, --pidfile=file Store process ID of daemon in file\n"
1303 " -q, --quit Quit after obtaining lease\n"
1304 " -r, --request=IP IP address to request (default: none)\n"
1305 " -s, --script=file Run file at dhcp events (default:\n"
1306 " " DEFAULT_SCRIPT ")\n"
1307 " -v, --version Display version");
1308 return 0;
1309 case 'i': 1294 case 'i':
1310 client_config.interface = optarg; 1295 client_config.interface = optarg;
1311 break; 1296 break;
@@ -1328,6 +1313,8 @@ int udhcpc_main(int argc, char *argv[])
1328 printf("udhcpcd, version %s\n\n", VERSION); 1313 printf("udhcpcd, version %s\n\n", VERSION);
1329 exit_client(0); 1314 exit_client(0);
1330 break; 1315 break;
1316 default:
1317 show_usage();
1331 } 1318 }
1332 } 1319 }
1333 1320