mirror of
https://github.com/sheumann/hush.git
synced 2025-01-12 14:30:54 +00:00
- add option to suppress the terse usage messages. Saves 6.8k for defconfig:
text data bss dec hex filename 861791 11264 1039140 1912195 1d2d83 busybox.have-terse-usage 854799 11264 1039140 1905203 1d1233 busybox.no-terse
This commit is contained in:
parent
2766eedde8
commit
81901a096c
10
Config.in
10
Config.in
@ -37,9 +37,19 @@ config CONFIG_FEATURE_BUFFERS_GO_IN_BSS
|
|||||||
|
|
||||||
endchoice
|
endchoice
|
||||||
|
|
||||||
|
config CONFIG_SHOW_USAGE
|
||||||
|
bool "Show terse applet usage messages"
|
||||||
|
default y
|
||||||
|
help
|
||||||
|
All BusyBox applets will show help messages when invoked with
|
||||||
|
wrong arguments. You can turn off printing these terse usage
|
||||||
|
messages if you say no here.
|
||||||
|
This will save you up to 7k.
|
||||||
|
|
||||||
config CONFIG_FEATURE_VERBOSE_USAGE
|
config CONFIG_FEATURE_VERBOSE_USAGE
|
||||||
bool "Show verbose applet usage messages"
|
bool "Show verbose applet usage messages"
|
||||||
default n
|
default n
|
||||||
|
select CONFIG_SHOW_USAGE
|
||||||
help
|
help
|
||||||
All BusyBox applets will show more verbose help messages when
|
All BusyBox applets will show more verbose help messages when
|
||||||
busybox is invoked with --help. This will add a lot of text to the
|
busybox is invoked with --help. This will add a lot of text to the
|
||||||
|
@ -32,6 +32,7 @@
|
|||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include "busybox.h"
|
#include "busybox.h"
|
||||||
|
|
||||||
|
#if ENABLE_SHOW_USAGE
|
||||||
const char usage_messages[] =
|
const char usage_messages[] =
|
||||||
|
|
||||||
#define MAKE_USAGE
|
#define MAKE_USAGE
|
||||||
@ -42,6 +43,7 @@ const char usage_messages[] =
|
|||||||
;
|
;
|
||||||
|
|
||||||
#undef MAKE_USAGE
|
#undef MAKE_USAGE
|
||||||
|
#endif /* ENABLE_SHOW_USAGE */
|
||||||
#undef APPLET
|
#undef APPLET
|
||||||
#undef APPLET_NOUSAGE
|
#undef APPLET_NOUSAGE
|
||||||
#undef PROTOTYPES
|
#undef PROTOTYPES
|
||||||
@ -407,6 +409,7 @@ static void check_suid (struct BB_applet *applet)
|
|||||||
|
|
||||||
void bb_show_usage (void)
|
void bb_show_usage (void)
|
||||||
{
|
{
|
||||||
|
#if ENABLE_SHOW_USAGE
|
||||||
const char *format_string;
|
const char *format_string;
|
||||||
const char *usage_string = usage_messages;
|
const char *usage_string = usage_messages;
|
||||||
int i;
|
int i;
|
||||||
@ -422,6 +425,7 @@ void bb_show_usage (void)
|
|||||||
format_string = "%s\n\nNo help available.\n\n";
|
format_string = "%s\n\nNo help available.\n\n";
|
||||||
fprintf (stderr, format_string, bb_msg_full_version, applet_using->name,
|
fprintf (stderr, format_string, bb_msg_full_version, applet_using->name,
|
||||||
usage_string);
|
usage_string);
|
||||||
|
#endif /* ENABLE_SHOW_USAGE */
|
||||||
|
|
||||||
exit (bb_default_error_retval);
|
exit (bb_default_error_retval);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user