aboutsummaryrefslogtreecommitdiff
path: root/shell/hush.c
diff options
context:
space:
mode:
Diffstat (limited to 'shell/hush.c')
-rw-r--r--shell/hush.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/shell/hush.c b/shell/hush.c
index 9e508fc6d..c0325cf5e 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -197,6 +197,11 @@
197//config: default y 197//config: default y
198//config: depends on HUSH || SH_IS_HUSH || BASH_IS_HUSH 198//config: depends on HUSH || SH_IS_HUSH || BASH_IS_HUSH
199//config: 199//config:
200//config:config HUSH_TEST
201//config: bool "test builtin"
202//config: default y
203//config: depends on HUSH || SH_IS_HUSH || BASH_IS_HUSH
204//config:
200//config:config HUSH_HELP 205//config:config HUSH_HELP
201//config: bool "help builtin" 206//config: bool "help builtin"
202//config: default y 207//config: default y
@@ -942,7 +947,9 @@ static int builtin_set(char **argv) FAST_FUNC;
942#endif 947#endif
943static int builtin_shift(char **argv) FAST_FUNC; 948static int builtin_shift(char **argv) FAST_FUNC;
944static int builtin_source(char **argv) FAST_FUNC; 949static int builtin_source(char **argv) FAST_FUNC;
950#if ENABLE_HUSH_TEST
945static int builtin_test(char **argv) FAST_FUNC; 951static int builtin_test(char **argv) FAST_FUNC;
952#endif
946#if ENABLE_HUSH_TRAP 953#if ENABLE_HUSH_TRAP
947static int builtin_trap(char **argv) FAST_FUNC; 954static int builtin_trap(char **argv) FAST_FUNC;
948#endif 955#endif
@@ -1061,7 +1068,9 @@ static const struct built_in_command bltins1[] = {
1061#endif 1068#endif
1062}; 1069};
1063static const struct built_in_command bltins2[] = { 1070static const struct built_in_command bltins2[] = {
1071#if ENABLE_HUSH_TEST
1064 BLTIN("[" , builtin_test , NULL), 1072 BLTIN("[" , builtin_test , NULL),
1073#endif
1065#if ENABLE_HUSH_ECHO 1074#if ENABLE_HUSH_ECHO
1066 BLTIN("echo" , builtin_echo , NULL), 1075 BLTIN("echo" , builtin_echo , NULL),
1067#endif 1076#endif
@@ -1069,7 +1078,9 @@ static const struct built_in_command bltins2[] = {
1069 BLTIN("printf" , builtin_printf , NULL), 1078 BLTIN("printf" , builtin_printf , NULL),
1070#endif 1079#endif
1071 BLTIN("pwd" , builtin_pwd , NULL), 1080 BLTIN("pwd" , builtin_pwd , NULL),
1081#if ENABLE_HUSH_TEST
1072 BLTIN("test" , builtin_test , NULL), 1082 BLTIN("test" , builtin_test , NULL),
1083#endif
1073}; 1084};
1074 1085
1075 1086
@@ -8791,6 +8802,7 @@ static int FAST_FUNC builtin_true(char **argv UNUSED_PARAM)
8791 return 0; 8802 return 0;
8792} 8803}
8793 8804
8805#if ENABLE_HUSH_TEST || ENABLE_HUSH_ECHO || ENABLE_HUSH_PRINTF || ENABLE_HUSH_KILL
8794static int run_applet_main(char **argv, int (*applet_main_func)(int argc, char **argv)) 8806static int run_applet_main(char **argv, int (*applet_main_func)(int argc, char **argv))
8795{ 8807{
8796 int argc = 0; 8808 int argc = 0;
@@ -8800,11 +8812,13 @@ static int run_applet_main(char **argv, int (*applet_main_func)(int argc, char *
8800 } 8812 }
8801 return applet_main_func(argc, argv - argc); 8813 return applet_main_func(argc, argv - argc);
8802} 8814}
8803 8815#endif
8816#if ENABLE_HUSH_TEST
8804static int FAST_FUNC builtin_test(char **argv) 8817static int FAST_FUNC builtin_test(char **argv)
8805{ 8818{
8806 return run_applet_main(argv, test_main); 8819 return run_applet_main(argv, test_main);
8807} 8820}
8821#endif
8808#if ENABLE_HUSH_ECHO 8822#if ENABLE_HUSH_ECHO
8809static int FAST_FUNC builtin_echo(char **argv) 8823static int FAST_FUNC builtin_echo(char **argv)
8810{ 8824{