aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik Andersen <andersen@codepoet.org>2000-04-09 18:27:46 +0000
committerErik Andersen <andersen@codepoet.org>2000-04-09 18:27:46 +0000
commita2685735b1ace4323f0c6fae6c31e0888ed62c34 (patch)
treec16e646e3ad10353af21e93e881d29d82ebf150e
parentf3b3d17060fe6dffab3e1ff7de393bd0618334ba (diff)
downloadbusybox-w32-a2685735b1ace4323f0c6fae6c31e0888ed62c34.tar.gz
busybox-w32-a2685735b1ace4323f0c6fae6c31e0888ed62c34.tar.bz2
busybox-w32-a2685735b1ace4323f0c6fae6c31e0888ed62c34.zip
Make tab completion an option
-Erik
-rw-r--r--busybox.def.h3
-rw-r--r--cmdedit.c7
-rw-r--r--shell/cmdedit.c7
3 files changed, 17 insertions, 0 deletions
diff --git a/busybox.def.h b/busybox.def.h
index cb864120b..eebe9b973 100644
--- a/busybox.def.h
+++ b/busybox.def.h
@@ -189,6 +189,9 @@
189// Enable command line editing in the shell 189// Enable command line editing in the shell
190#define BB_FEATURE_SH_COMMAND_EDITING 190#define BB_FEATURE_SH_COMMAND_EDITING
191// 191//
192// Enable tab completion in the shell (not yet working very well)
193//#define BB_FEATURE_SH_TAB_COMPLETION
194//
192//Turn on extra fbset options 195//Turn on extra fbset options
193//#define BB_FEATURE_FBSET_FANCY 196//#define BB_FEATURE_FBSET_FANCY
194// 197//
diff --git a/cmdedit.c b/cmdedit.c
index 2c16276db..d15c69497 100644
--- a/cmdedit.c
+++ b/cmdedit.c
@@ -177,6 +177,8 @@ void input_backspace(int outputFd, int *cursor, int *len)
177 } 177 }
178} 178}
179 179
180#ifdef BB_FEATURE_SH_TAB_COMPLETION
181
180char** username_completion_matches(char* command, int *num_matches) 182char** username_completion_matches(char* command, int *num_matches)
181{ 183{
182 char **matches = (char **) NULL; 184 char **matches = (char **) NULL;
@@ -225,6 +227,7 @@ char** find_path_executable_n_cwd_matches(char* command, int *num_matches)
225 227
226 return (matches); 228 return (matches);
227} 229}
230#endif
228 231
229/* 232/*
230 * This function is used to grab a character buffer 233 * This function is used to grab a character buffer
@@ -340,6 +343,7 @@ extern int cmdedit_read_input(char* prompt, int inputFd, int outputFd,
340 } 343 }
341 break; 344 break;
342 case '\t': 345 case '\t':
346#ifdef BB_FEATURE_SH_TAB_COMPLETION
343 { 347 {
344 /* Do TAB completion */ 348 /* Do TAB completion */
345 static int num_matches=0; 349 static int num_matches=0;
@@ -436,6 +440,9 @@ extern int cmdedit_read_input(char* prompt, int inputFd, int outputFd,
436 } 440 }
437 break; 441 break;
438 } 442 }
443#else
444 break;
445#endif
439 case '\b': 446 case '\b':
440 case DEL: 447 case DEL:
441 /* Backspace */ 448 /* Backspace */
diff --git a/shell/cmdedit.c b/shell/cmdedit.c
index 2c16276db..d15c69497 100644
--- a/shell/cmdedit.c
+++ b/shell/cmdedit.c
@@ -177,6 +177,8 @@ void input_backspace(int outputFd, int *cursor, int *len)
177 } 177 }
178} 178}
179 179
180#ifdef BB_FEATURE_SH_TAB_COMPLETION
181
180char** username_completion_matches(char* command, int *num_matches) 182char** username_completion_matches(char* command, int *num_matches)
181{ 183{
182 char **matches = (char **) NULL; 184 char **matches = (char **) NULL;
@@ -225,6 +227,7 @@ char** find_path_executable_n_cwd_matches(char* command, int *num_matches)
225 227
226 return (matches); 228 return (matches);
227} 229}
230#endif
228 231
229/* 232/*
230 * This function is used to grab a character buffer 233 * This function is used to grab a character buffer
@@ -340,6 +343,7 @@ extern int cmdedit_read_input(char* prompt, int inputFd, int outputFd,
340 } 343 }
341 break; 344 break;
342 case '\t': 345 case '\t':
346#ifdef BB_FEATURE_SH_TAB_COMPLETION
343 { 347 {
344 /* Do TAB completion */ 348 /* Do TAB completion */
345 static int num_matches=0; 349 static int num_matches=0;
@@ -436,6 +440,9 @@ extern int cmdedit_read_input(char* prompt, int inputFd, int outputFd,
436 } 440 }
437 break; 441 break;
438 } 442 }
443#else
444 break;
445#endif
439 case '\b': 446 case '\b':
440 case DEL: 447 case DEL:
441 /* Backspace */ 448 /* Backspace */