diff options
Diffstat (limited to 'networking/udhcp/dhcpc.c')
-rw-r--r-- | networking/udhcp/dhcpc.c | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/networking/udhcp/dhcpc.c b/networking/udhcp/dhcpc.c index d18a963a9..55664abf9 100644 --- a/networking/udhcp/dhcpc.c +++ b/networking/udhcp/dhcpc.c | |||
@@ -75,6 +75,35 @@ struct client_config_t client_config = { | |||
75 | arp: "\0\0\0\0\0\0", /* appease gcc-3.0 */ | 75 | arp: "\0\0\0\0\0\0", /* appease gcc-3.0 */ |
76 | }; | 76 | }; |
77 | 77 | ||
78 | #ifndef IN_BUSYBOX | ||
79 | static void __attribute__ ((noreturn)) show_usage(void) | ||
80 | { | ||
81 | printf( | ||
82 | "Usage: udhcpc [OPTIONS]\n\n" | ||
83 | " -c, --clientid=CLIENTID Client identifier\n" | ||
84 | " -H, --hostname=HOSTNAME Client hostname\n" | ||
85 | " -h Alias for -H\n" | ||
86 | " -f, --foreground Do not fork after getting lease\n" | ||
87 | " -b, --background Fork to background if lease cannot be\n" | ||
88 | " immediately negotiated.\n" | ||
89 | " -i, --interface=INTERFACE Interface to use (default: eth0)\n" | ||
90 | " -n, --now Exit with failure if lease cannot be\n" | ||
91 | " immediately negotiated.\n" | ||
92 | " -p, --pidfile=file Store process ID of daemon in file\n" | ||
93 | " -q, --quit Quit after obtaining lease\n" | ||
94 | " -r, --request=IP IP address to request (default: none)\n" | ||
95 | " -s, --script=file Run file at dhcp events (default:\n" | ||
96 | " " DEFAULT_SCRIPT ")\n" | ||
97 | " -v, --version Display version\n" | ||
98 | ); | ||
99 | exit(0); | ||
100 | } | ||
101 | #else | ||
102 | #define show_usage bb_show_usage | ||
103 | extern void show_usage(void) __attribute__ ((noreturn)); | ||
104 | #endif | ||
105 | |||
106 | |||
78 | /* just a little helper */ | 107 | /* just a little helper */ |
79 | static void change_mode(int new_mode) | 108 | static void change_mode(int new_mode) |
80 | { | 109 | { |
@@ -233,7 +262,7 @@ int udhcpc_main(int argc, char *argv[]) | |||
233 | return(0); | 262 | return(0); |
234 | break; | 263 | break; |
235 | default: | 264 | default: |
236 | bb_show_usage(); | 265 | show_usage(); |
237 | } | 266 | } |
238 | } | 267 | } |
239 | 268 | ||