ash: factor out ASH_HELP config option

It used to be aliased to !FEATURE_SH_EXTRA_QUIET for ash,
while hush had it separate from FEATURE_SH_EXTRA_QUIET.

Bring ash in line with hush.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko 2014-09-08 16:52:39 +02:00
parent 3e9b13e4c5
commit 2ec34969e7

View File

@ -143,6 +143,13 @@
//config: help //config: help
//config: Enable support for test builtin in ash. //config: Enable support for test builtin in ash.
//config: //config:
//config:config ASH_HELP
//config: bool "help builtin"
//config: default y
//config: depends on ASH
//config: help
//config: Enable help builtin in ash.
//config:
//config:config ASH_CMDCMD //config:config ASH_CMDCMD
//config: bool "'command' command to override shell builtins" //config: bool "'command' command to override shell builtins"
//config: default y //config: default y
@ -8804,8 +8811,8 @@ setinteractive(int on)
if (!did_banner) { if (!did_banner) {
/* note: ash and hush share this string */ /* note: ash and hush share this string */
out1fmt("\n\n%s %s\n" out1fmt("\n\n%s %s\n"
"Enter 'help' for a list of built-in commands." IF_ASH_HELP("Enter 'help' for a list of built-in commands.\n")
"\n\n", "\n",
bb_banner, bb_banner,
"built-in shell (ash)" "built-in shell (ash)"
); );
@ -9058,7 +9065,7 @@ static int exportcmd(int, char **) FAST_FUNC;
#if ENABLE_ASH_GETOPTS #if ENABLE_ASH_GETOPTS
static int getoptscmd(int, char **) FAST_FUNC; static int getoptscmd(int, char **) FAST_FUNC;
#endif #endif
#if !ENABLE_FEATURE_SH_EXTRA_QUIET #if ENABLE_ASH_HELP
static int helpcmd(int, char **) FAST_FUNC; static int helpcmd(int, char **) FAST_FUNC;
#endif #endif
#if MAX_HISTORY #if MAX_HISTORY
@ -9134,7 +9141,7 @@ static const struct builtincmd builtintab[] = {
{ BUILTIN_REGULAR "getopts" , getoptscmd }, { BUILTIN_REGULAR "getopts" , getoptscmd },
#endif #endif
{ BUILTIN_NOSPEC "hash" , hashcmd }, { BUILTIN_NOSPEC "hash" , hashcmd },
#if !ENABLE_FEATURE_SH_EXTRA_QUIET #if ENABLE_ASH_HELP
{ BUILTIN_NOSPEC "help" , helpcmd }, { BUILTIN_NOSPEC "help" , helpcmd },
#endif #endif
#if MAX_HISTORY #if MAX_HISTORY
@ -12611,10 +12618,7 @@ trapcmd(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
/* ============ Builtins */ /* ============ Builtins */
#if !ENABLE_FEATURE_SH_EXTRA_QUIET #if ENABLE_ASH_HELP
/*
* Lists available builtins
*/
static int FAST_FUNC static int FAST_FUNC
helpcmd(int argc UNUSED_PARAM, char **argv UNUSED_PARAM) helpcmd(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
{ {
@ -12632,7 +12636,7 @@ helpcmd(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
col = 0; col = 0;
} }
} }
#if ENABLE_FEATURE_SH_STANDALONE # if ENABLE_FEATURE_SH_STANDALONE
{ {
const char *a = applet_names; const char *a = applet_names;
while (*a) { while (*a) {
@ -12644,11 +12648,11 @@ helpcmd(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
a += strlen(a) + 1; a += strlen(a) + 1;
} }
} }
#endif # endif
out1fmt("\n\n"); out1fmt("\n\n");
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }
#endif /* FEATURE_SH_EXTRA_QUIET */ #endif
#if MAX_HISTORY #if MAX_HISTORY
static int FAST_FUNC static int FAST_FUNC