diff options
Diffstat (limited to 'util-linux/getopt.c')
-rw-r--r-- | util-linux/getopt.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/util-linux/getopt.c b/util-linux/getopt.c index a5e674368..5ee13ec8b 100644 --- a/util-linux/getopt.c +++ b/util-linux/getopt.c | |||
@@ -266,18 +266,17 @@ static void set_shell(const char *new_shell) | |||
266 | */ | 266 | */ |
267 | 267 | ||
268 | #if ENABLE_GETOPT_LONG | 268 | #if ENABLE_GETOPT_LONG |
269 | static const struct option longopts[] = { | 269 | static const char getopt_longopts[] = |
270 | { "options", required_argument, NULL, 'o' }, | 270 | "options\0" Required_argument "o" |
271 | { "longoptions", required_argument, NULL, 'l' }, | 271 | "longoptions\0" Required_argument "l" |
272 | { "quiet", no_argument, NULL, 'q' }, | 272 | "quiet\0" No_argument "q" |
273 | { "quiet-output", no_argument, NULL, 'Q' }, | 273 | "quiet-output\0" No_argument "Q" |
274 | { "shell", required_argument, NULL, 's' }, | 274 | "shell\0" Required_argument "s" |
275 | { "test", no_argument, NULL, 'T' }, | 275 | "test\0" No_argument "T" |
276 | { "unquoted", no_argument, NULL, 'u' }, | 276 | "unquoted\0" No_argument "u" |
277 | { "alternative", no_argument, NULL, 'a' }, | 277 | "alternative\0" No_argument "a" |
278 | { "name", required_argument, NULL, 'n' }, | 278 | "name\0" Required_argument "n" |
279 | { NULL, 0, NULL, 0 } | 279 | "\0"; |
280 | }; | ||
281 | #endif | 280 | #endif |
282 | 281 | ||
283 | int getopt_main(int argc, char *argv[]); | 282 | int getopt_main(int argc, char *argv[]); |
@@ -317,7 +316,7 @@ int getopt_main(int argc, char *argv[]) | |||
317 | #if !ENABLE_GETOPT_LONG | 316 | #if !ENABLE_GETOPT_LONG |
318 | opt = getopt32(argc, argv, "+o:n:qQs:Tu", &optstr, &name, &s_arg); | 317 | opt = getopt32(argc, argv, "+o:n:qQs:Tu", &optstr, &name, &s_arg); |
319 | #else | 318 | #else |
320 | applet_long_options = longopts; | 319 | applet_long_options = getopt_longopts; |
321 | opt_complementary = "l::"; | 320 | opt_complementary = "l::"; |
322 | opt = getopt32(argc, argv, "+o:n:qQs:Tual:", | 321 | opt = getopt32(argc, argv, "+o:n:qQs:Tual:", |
323 | &optstr, &name, &s_arg, &l_arg); | 322 | &optstr, &name, &s_arg, &l_arg); |