diff options
author | Erik Andersen <andersen@codepoet.org> | 2000-04-09 18:27:46 +0000 |
---|---|---|
committer | Erik Andersen <andersen@codepoet.org> | 2000-04-09 18:27:46 +0000 |
commit | a2685735b1ace4323f0c6fae6c31e0888ed62c34 (patch) | |
tree | c16e646e3ad10353af21e93e881d29d82ebf150e | |
parent | f3b3d17060fe6dffab3e1ff7de393bd0618334ba (diff) | |
download | busybox-a2685735b1ace4323f0c6fae6c31e0888ed62c34.tar.gz |
Make tab completion an option
-Erik
-rw-r--r-- | busybox.def.h | 3 | ||||
-rw-r--r-- | cmdedit.c | 7 | ||||
-rw-r--r-- | shell/cmdedit.c | 7 |
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 @@ // Enable command line editing in the shell #define BB_FEATURE_SH_COMMAND_EDITING // +// Enable tab completion in the shell (not yet working very well) +//#define BB_FEATURE_SH_TAB_COMPLETION +// //Turn on extra fbset options //#define BB_FEATURE_FBSET_FANCY // @@ -177,6 +177,8 @@ void input_backspace(int outputFd, int *cursor, int *len) } } +#ifdef BB_FEATURE_SH_TAB_COMPLETION + char** username_completion_matches(char* command, int *num_matches) { char **matches = (char **) NULL; @@ -225,6 +227,7 @@ char** find_path_executable_n_cwd_matches(char* command, int *num_matches) return (matches); } +#endif /* * This function is used to grab a character buffer @@ -340,6 +343,7 @@ extern int cmdedit_read_input(char* prompt, int inputFd, int outputFd, } break; case '\t': +#ifdef BB_FEATURE_SH_TAB_COMPLETION { /* Do TAB completion */ static int num_matches=0; @@ -436,6 +440,9 @@ extern int cmdedit_read_input(char* prompt, int inputFd, int outputFd, } break; } +#else + break; +#endif case '\b': case DEL: /* 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) } } +#ifdef BB_FEATURE_SH_TAB_COMPLETION + char** username_completion_matches(char* command, int *num_matches) { char **matches = (char **) NULL; @@ -225,6 +227,7 @@ char** find_path_executable_n_cwd_matches(char* command, int *num_matches) return (matches); } +#endif /* * This function is used to grab a character buffer @@ -340,6 +343,7 @@ extern int cmdedit_read_input(char* prompt, int inputFd, int outputFd, } break; case '\t': +#ifdef BB_FEATURE_SH_TAB_COMPLETION { /* Do TAB completion */ static int num_matches=0; @@ -436,6 +440,9 @@ extern int cmdedit_read_input(char* prompt, int inputFd, int outputFd, } break; } +#else + break; +#endif case '\b': case DEL: /* Backspace */ |