diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2017-08-06 18:54:16 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2017-08-06 18:54:16 +0200 |
commit | ab2338110094fe371f44657b17e6980afd37c535 (patch) | |
tree | 16c2d8b59b9c8e2c0e101dd7ace83997687f5bf7 /console-tools | |
parent | b83db4ddae4c88b8837cd721c0f74e83bf956a5e (diff) | |
download | busybox-w32-ab2338110094fe371f44657b17e6980afd37c535.tar.gz busybox-w32-ab2338110094fe371f44657b17e6980afd37c535.tar.bz2 busybox-w32-ab2338110094fe371f44657b17e6980afd37c535.zip |
setconsole: since SUSE version has no -r, nuke our --reset longopt
Why we even bother inventing incompatible longopts?!
function old new delta
packed_usage 31734 31738 +4
static.setconsole_longopts 9 - -9
setconsole_main 94 84 -10
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 1/1 up/down: 4/-19) Total: -15 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'console-tools')
-rw-r--r-- | console-tools/setconsole.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/console-tools/setconsole.c b/console-tools/setconsole.c index ad0f756ca..fa5269ebb 100644 --- a/console-tools/setconsole.c +++ b/console-tools/setconsole.c | |||
@@ -25,11 +25,15 @@ | |||
25 | //kbuild:lib-$(CONFIG_SETCONSOLE) += setconsole.o | 25 | //kbuild:lib-$(CONFIG_SETCONSOLE) += setconsole.o |
26 | 26 | ||
27 | //usage:#define setconsole_trivial_usage | 27 | //usage:#define setconsole_trivial_usage |
28 | //usage: "[-r" IF_FEATURE_SETCONSOLE_LONG_OPTIONS("|--reset") "] [DEVICE]" | 28 | //usage: "[-r] [DEVICE]" |
29 | //usage:#define setconsole_full_usage "\n\n" | 29 | //usage:#define setconsole_full_usage "\n\n" |
30 | //usage: "Redirect system console output to DEVICE (default: /dev/tty)\n" | 30 | //usage: "Redirect system console output to DEVICE (default: /dev/tty)\n" |
31 | //usage: "\n -r Reset output to /dev/console" | 31 | //usage: "\n -r Reset output to /dev/console" |
32 | 32 | ||
33 | /* It was a bbox-specific invention, but SUSE does have a similar utility. | ||
34 | * SUSE has no -r option, though. | ||
35 | */ | ||
36 | |||
33 | #include "libbb.h" | 37 | #include "libbb.h" |
34 | 38 | ||
35 | int setconsole_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; | 39 | int setconsole_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
@@ -38,12 +42,6 @@ int setconsole_main(int argc UNUSED_PARAM, char **argv) | |||
38 | const char *device = CURRENT_TTY; | 42 | const char *device = CURRENT_TTY; |
39 | bool reset; | 43 | bool reset; |
40 | 44 | ||
41 | #if ENABLE_FEATURE_SETCONSOLE_LONG_OPTIONS | ||
42 | static const char setconsole_longopts[] ALIGN1 = | ||
43 | "reset\0" No_argument "r" | ||
44 | ; | ||
45 | applet_long_options = setconsole_longopts; | ||
46 | #endif | ||
47 | /* at most one non-option argument */ | 45 | /* at most one non-option argument */ |
48 | opt_complementary = "?1"; | 46 | opt_complementary = "?1"; |
49 | reset = getopt32(argv, "r"); | 47 | reset = getopt32(argv, "r"); |