*: fix up use of "getopt_longopts" for longopts not in getopt applet

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko 2017-08-08 14:59:35 +02:00
parent ddd1ee4443
commit 00677b5e35
4 changed files with 8 additions and 8 deletions

View File

@ -367,7 +367,7 @@ int conspy_main(int argc UNUSED_PARAM, char **argv)
unsigned ttynum; unsigned ttynum;
int poll_timeout_ms; int poll_timeout_ms;
#if ENABLE_LONG_OPTS #if ENABLE_LONG_OPTS
static const char getopt_longopts[] ALIGN1 = static const char conspy_longopts[] ALIGN1 =
"viewonly\0" No_argument "v" "viewonly\0" No_argument "v"
"createdevice\0" No_argument "c" "createdevice\0" No_argument "c"
"neverquit\0" No_argument "Q" "neverquit\0" No_argument "Q"
@ -378,7 +378,7 @@ int conspy_main(int argc UNUSED_PARAM, char **argv)
"framebuffer\0" No_argument "F" "framebuffer\0" No_argument "F"
; ;
applet_long_options = getopt_longopts; applet_long_options = conspy_longopts;
#endif #endif
#define keybuf bb_common_bufsiz1 #define keybuf bb_common_bufsiz1
setup_common_bufsiz(); setup_common_bufsiz();

View File

@ -38,13 +38,13 @@ int flock_main(int argc UNUSED_PARAM, char **argv)
}; };
#if ENABLE_LONG_OPTS #if ENABLE_LONG_OPTS
static const char getopt_longopts[] ALIGN1 = static const char flock_longopts[] ALIGN1 =
"shared\0" No_argument "s" "shared\0" No_argument "s"
"exclusive\0" No_argument "x" "exclusive\0" No_argument "x"
"unlock\0" No_argument "u" "unlock\0" No_argument "u"
"nonblock\0" No_argument "n" "nonblock\0" No_argument "n"
; ;
applet_long_options = getopt_longopts; applet_long_options = flock_longopts;
#endif #endif
opt_complementary = "-1"; opt_complementary = "-1";

View File

@ -63,13 +63,13 @@ int fstrim_main(int argc UNUSED_PARAM, char **argv)
}; };
#if ENABLE_LONG_OPTS #if ENABLE_LONG_OPTS
static const char getopt_longopts[] ALIGN1 = static const char fstrim_longopts[] ALIGN1 =
"offset\0" Required_argument "o" "offset\0" Required_argument "o"
"length\0" Required_argument "l" "length\0" Required_argument "l"
"minimum\0" Required_argument "m" "minimum\0" Required_argument "m"
"verbose\0" No_argument "v" "verbose\0" No_argument "v"
; ;
applet_long_options = getopt_longopts; applet_long_options = fstrim_longopts;
#endif #endif
opt_complementary = "=1"; /* exactly one non-option arg: the mountpoint */ opt_complementary = "=1"; /* exactly one non-option arg: the mountpoint */

View File

@ -71,7 +71,7 @@ int script_main(int argc UNUSED_PARAM, char **argv)
}; };
#if ENABLE_LONG_OPTS #if ENABLE_LONG_OPTS
static const char getopt_longopts[] ALIGN1 = static const char script_longopts[] ALIGN1 =
"append\0" No_argument "a" "append\0" No_argument "a"
"command\0" Required_argument "c" "command\0" Required_argument "c"
"flush\0" No_argument "f" "flush\0" No_argument "f"
@ -79,7 +79,7 @@ int script_main(int argc UNUSED_PARAM, char **argv)
"timing\0" Optional_argument "t" "timing\0" Optional_argument "t"
; ;
applet_long_options = getopt_longopts; applet_long_options = script_longopts;
#endif #endif
opt_complementary = "?1"; /* max one arg */ opt_complementary = "?1"; /* max one arg */