aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGlenn L McGrath <bug1@ihug.co.nz>2004-01-03 12:07:32 +0000
committerGlenn L McGrath <bug1@ihug.co.nz>2004-01-03 12:07:32 +0000
commit3b251857334fc3b7ae075905908d67a08885da76 (patch)
tree515879419d105152819dde4b8f52afd78ce4d11b
parentffa28d1b468a9318affcbdc27277f43d10b00f24 (diff)
downloadbusybox-w32-3b251857334fc3b7ae075905908d67a08885da76.tar.gz
busybox-w32-3b251857334fc3b7ae075905908d67a08885da76.tar.bz2
busybox-w32-3b251857334fc3b7ae075905908d67a08885da76.zip
Declare dependencies of command line editing in the build system
-rw-r--r--shell/Config.in67
-rw-r--r--shell/cmdedit.c12
2 files changed, 34 insertions, 45 deletions
diff --git a/shell/Config.in b/shell/Config.in
index 016af719a..892b96e78 100644
--- a/shell/Config.in
+++ b/shell/Config.in
@@ -137,71 +137,70 @@ config CONFIG_MSH
137comment "Bourne Shell Options" 137comment "Bourne Shell Options"
138 depends on CONFIG_MSH || CONFIG_LASH || CONFIG_HUSH || CONFIG_ASH 138 depends on CONFIG_MSH || CONFIG_LASH || CONFIG_HUSH || CONFIG_ASH
139 139
140config CONFIG_FEATURE_COMMAND_EDITING 140config CONFIG_FEATURE_SH_EXTRA_QUIET
141 bool "command line editing" 141 bool "Hide message on interactive shell startup"
142 default n 142 default n
143 depends on CONFIG_MSH || CONFIG_LASH || CONFIG_HUSH || CONFIG_ASH 143 depends on CONFIG_MSH || CONFIG_LASH || CONFIG_HUSH || CONFIG_ASH
144 help 144 help
145 Enable command editing in shell. 145 Remove the busybox introduction when starting a shell.
146 146
147config CONFIG_FEATURE_COMMAND_SAVEHISTORY 147config CONFIG_FEATURE_SH_STANDALONE_SHELL
148 bool " history saving" 148 bool "Standalone shell"
149 default n 149 default n
150 depends on CONFIG_ASH 150 depends on CONFIG_MSH || CONFIG_LASH || CONFIG_HUSH || CONFIG_ASH
151 help 151 help
152 Enable history saving in ash shell. 152 Have all the busybox commands built into the shell, creating
153 a standalone shell.
153 154
154config CONFIG_FEATURE_COMMAND_TAB_COMPLETION 155config CONFIG_FEATURE_SH_APPLETS_ALWAYS_WIN
155 bool "tab completion" 156 bool "Standalone shell -- applets always win"
156 default n 157 default n
157 depends on CONFIG_MSH || CONFIG_LASH || CONFIG_HUSH || CONFIG_ASH 158 depends on CONFIG_FEATURE_SH_STANDALONE_SHELL
158 help 159 help
159 Enable tab completion in shell. 160 Use a command builtin to the shell over one with the same name,
161 that may be on the system.
160 162
161config CONFIG_FEATURE_COMMAND_USERNAME_COMPLETION 163config CONFIG_FEATURE_COMMAND_EDITING
162 bool "username completion" 164 bool "command line editing"
163 default n 165 default n
164 depends on CONFIG_MSH || CONFIG_LASH || CONFIG_HUSH || CONFIG_ASH 166 depends on CONFIG_MSH || CONFIG_LASH || CONFIG_HUSH || CONFIG_ASH
165 help 167 help
166 Enable username completion in shell. 168 Enable command editing in shell.
167 169
168config CONFIG_FEATURE_COMMAND_HISTORY 170config CONFIG_FEATURE_COMMAND_HISTORY
169 int "history size" 171 int "history size"
170 default 15 172 default 15
171 depends on CONFIG_MSH || CONFIG_LASH || CONFIG_HUSH || CONFIG_ASH 173 depends on CONFIG_FEATURE_COMMAND_EDITING
172 help 174 help
173 Specify command history size in shell. 175 Specify command history size in shell.
174 176
175config CONFIG_FEATURE_SH_STANDALONE_SHELL 177config CONFIG_FEATURE_COMMAND_SAVEHISTORY
176 bool "Standalone shell" 178 bool "history saving"
177 default n 179 default n
178 depends on CONFIG_MSH || CONFIG_LASH || CONFIG_HUSH || CONFIG_ASH 180 depends on CONFIG_ASH && CONFIG_FEATURE_COMMAND_EDITING
179 help 181 help
180 Have all the busybox commands built into the shell, creating 182 Enable history saving in ash shell.
181 a standalone shell.
182 183
183config CONFIG_FEATURE_SH_APPLETS_ALWAYS_WIN 184config CONFIG_FEATURE_COMMAND_TAB_COMPLETION
184 bool "Standalone shell -- applets always win" 185 bool "tab completion"
185 default n 186 default n
186 depends on CONFIG_FEATURE_SH_STANDALONE_SHELL 187 depends on CONFIG_FEATURE_COMMAND_EDITING
187 help 188 help
188 Use a command builtin to the shell over one with the same name, 189 Enable tab completion in shell.
189 that may be on the system. 190
191config CONFIG_FEATURE_COMMAND_USERNAME_COMPLETION
192 bool "username completion"
193 default n
194 depends on CONFIG_FEATURE_COMMAND_TAB_COMPLETION
195 help
196 Enable username completion in shell.
190 197
191config CONFIG_FEATURE_SH_FANCY_PROMPT 198config CONFIG_FEATURE_SH_FANCY_PROMPT
192 bool "Fancy shell prompts" 199 bool "Fancy shell prompts"
193 default n 200 default n
194 depends on CONFIG_MSH || CONFIG_LASH || CONFIG_HUSH || CONFIG_ASH 201 depends on CONFIG_FEATURE_COMMAND_EDITING
195 help 202 help
196 Setting this option allows for prompts to use things like \w and 203 Setting this option allows for prompts to use things like \w and
197 \$ and also using escape codes. 204 \$ and also using escape codes.
198 205
199config CONFIG_FEATURE_SH_EXTRA_QUIET
200 bool "Hide message on interactive shell startup"
201 default n
202 depends on CONFIG_MSH || CONFIG_LASH || CONFIG_HUSH || CONFIG_ASH
203 help
204 Remove the busybox introduction when starting a shell.
205
206endmenu 206endmenu
207
diff --git a/shell/cmdedit.c b/shell/cmdedit.c
index a78642b9d..884489b45 100644
--- a/shell/cmdedit.c
+++ b/shell/cmdedit.c
@@ -49,11 +49,7 @@
49#define Isprint(c) ( (c) >= ' ' && (c) != ((unsigned char)'\233') ) 49#define Isprint(c) ( (c) >= ' ' && (c) != ((unsigned char)'\233') )
50#endif 50#endif
51 51
52#ifndef TEST 52#ifdef TEST
53
54#define D(x)
55
56#else
57 53
58/* pretect redefined for test */ 54/* pretect redefined for test */
59#undef CONFIG_FEATURE_COMMAND_EDITING 55#undef CONFIG_FEATURE_COMMAND_EDITING
@@ -68,8 +64,6 @@
68#define CONFIG_FEATURE_NONPRINTABLE_INVERSE_PUT 64#define CONFIG_FEATURE_NONPRINTABLE_INVERSE_PUT
69#define CONFIG_FEATURE_CLEAN_UP 65#define CONFIG_FEATURE_CLEAN_UP
70 66
71#define D(x) x
72
73#endif /* TEST */ 67#endif /* TEST */
74 68
75#ifdef CONFIG_FEATURE_COMMAND_TAB_COMPLETION 69#ifdef CONFIG_FEATURE_COMMAND_TAB_COMPLETION
@@ -79,10 +73,6 @@
79 73
80#ifdef CONFIG_FEATURE_COMMAND_EDITING 74#ifdef CONFIG_FEATURE_COMMAND_EDITING
81 75
82#ifndef CONFIG_FEATURE_COMMAND_TAB_COMPLETION
83#undef CONFIG_FEATURE_COMMAND_USERNAME_COMPLETION
84#endif
85
86#if defined(CONFIG_FEATURE_COMMAND_USERNAME_COMPLETION) || defined(CONFIG_FEATURE_SH_FANCY_PROMPT) 76#if defined(CONFIG_FEATURE_COMMAND_USERNAME_COMPLETION) || defined(CONFIG_FEATURE_SH_FANCY_PROMPT)
87#define CONFIG_FEATURE_GETUSERNAME_AND_HOMEDIR 77#define CONFIG_FEATURE_GETUSERNAME_AND_HOMEDIR
88#endif 78#endif