Several features were hard coded on. Stop that. List tab completion

as working (thanks Vladimir!) and taking 4k.
 -Erik
This commit is contained in:
Eric Andersen 2001-02-16 20:26:50 +00:00
parent 6faae7deb4
commit 28a78ab62c
3 changed files with 20 additions and 29 deletions

View File

@ -262,10 +262,9 @@
// Only relevant if BB_SH is enabled. // Only relevant if BB_SH is enabled.
#define BB_FEATURE_SH_APPLETS_ALWAYS_WIN #define BB_FEATURE_SH_APPLETS_ALWAYS_WIN
// //
// Enable tab completion in the shell (not yet // Enable tab completion in the shell. This is now working quite nicely.
// working very well -- so don't turn this on) // This feature adds a bit over 4k. Only relevant if BB_SH is enabled.
// Only relevant if BB_SH is enabled. //#define BB_FEATURE_SH_TAB_COMPLETION
#define BB_FEATURE_SH_TAB_COMPLETION
// //
// Enable a simpler shell prompt of the form "path #" // Enable a simpler shell prompt of the form "path #"
// instead of the default "[username@hostname path]#" // instead of the default "[username@hostname path]#"
@ -277,7 +276,7 @@
#define BB_FEATURE_SH_SIMPLE_PROMPT #define BB_FEATURE_SH_SIMPLE_PROMPT
// //
// Attempts to match usernames in a ~-prefixed path // Attempts to match usernames in a ~-prefixed path
//#define BB_FEATURE_USERNAME_COMPLETION //#define BB_FEATURE_SH_USERNAME_COMPLETION
// //
//Turn on extra fbset options //Turn on extra fbset options
//#define BB_FEATURE_FBSET_FANCY //#define BB_FEATURE_FBSET_FANCY

View File

@ -41,12 +41,8 @@
#else #else
#define BB_FEATURE_SH_COMMAND_EDITING //#define BB_FEATURE_NONPRINTABLE_INVERSE_PUT
#define BB_FEATURE_SH_TAB_COMPLETION //#define BB_FEATURE_BASH_STYLE_PROMT
#define BB_FEATURE_USERNAME_COMPLETION
#define BB_FEATURE_NONPRINTABLE_INVERSE_PUT
#define BB_FEATURE_BASH_STYLE_PROMT
#define BB_FEATURE_CLEAN_UP
#define TRUE 1 #define TRUE 1
#define FALSE 0 #define FALSE 0
@ -57,10 +53,10 @@
#ifdef BB_FEATURE_SH_COMMAND_EDITING #ifdef BB_FEATURE_SH_COMMAND_EDITING
#ifndef BB_FEATURE_SH_TAB_COMPLETION #ifndef BB_FEATURE_SH_TAB_COMPLETION
#undef BB_FEATURE_USERNAME_COMPLETION #undef BB_FEATURE_SH_USERNAME_COMPLETION
#endif #endif
#if defined(BB_FEATURE_USERNAME_COMPLETION) || defined(BB_FEATURE_BASH_STYLE_PROMT) #if defined(BB_FEATURE_SH_USERNAME_COMPLETION) || defined(BB_FEATURE_BASH_STYLE_PROMT)
#define BB_FEATURE_GETUSERNAME_AND_HOMEDIR #define BB_FEATURE_GETUSERNAME_AND_HOMEDIR
#endif #endif
@ -626,7 +622,7 @@ static int is_execute(const struct stat *st)
return FALSE; return FALSE;
} }
#ifdef BB_FEATURE_USERNAME_COMPLETION #ifdef BB_FEATURE_SH_USERNAME_COMPLETION
static char **username_tab_completion(char *ud, int *num_matches) static char **username_tab_completion(char *ud, int *num_matches)
{ {
@ -688,7 +684,7 @@ static char **username_tab_completion(char *ud, int *num_matches)
return (matches); return (matches);
} }
} }
#endif /* BB_FEATURE_USERNAME_COMPLETION */ #endif /* BB_FEATURE_SH_USERNAME_COMPLETION */
enum { enum {
FIND_EXE_ONLY = 0, FIND_EXE_ONLY = 0,
@ -785,7 +781,7 @@ static char **exe_n_cwd_tab_completion(char *command, int *num_matches,
strcpy(dirbuf, command); strcpy(dirbuf, command);
/* set dir only */ /* set dir only */
dirbuf[(pfind - command) + 1] = 0; dirbuf[(pfind - command) + 1] = 0;
#ifdef BB_FEATURE_USERNAME_COMPLETION #ifdef BB_FEATURE_SH_USERNAME_COMPLETION
if (dirbuf[0] == '~') /* ~/... or ~user/... */ if (dirbuf[0] == '~') /* ~/... or ~user/... */
username_tab_completion(dirbuf, 0); username_tab_completion(dirbuf, 0);
#endif #endif
@ -1066,7 +1062,7 @@ static void input_tab(int *lastWasTab)
/* Free up any memory already allocated */ /* Free up any memory already allocated */
input_tab(0); input_tab(0);
#ifdef BB_FEATURE_USERNAME_COMPLETION #ifdef BB_FEATURE_SH_USERNAME_COMPLETION
/* If the word starts with `~' and there is no slash in the word, /* If the word starts with `~' and there is no slash in the word,
* then try completing this word as a username. */ * then try completing this word as a username. */

View File

@ -41,12 +41,8 @@
#else #else
#define BB_FEATURE_SH_COMMAND_EDITING //#define BB_FEATURE_NONPRINTABLE_INVERSE_PUT
#define BB_FEATURE_SH_TAB_COMPLETION //#define BB_FEATURE_BASH_STYLE_PROMT
#define BB_FEATURE_USERNAME_COMPLETION
#define BB_FEATURE_NONPRINTABLE_INVERSE_PUT
#define BB_FEATURE_BASH_STYLE_PROMT
#define BB_FEATURE_CLEAN_UP
#define TRUE 1 #define TRUE 1
#define FALSE 0 #define FALSE 0
@ -57,10 +53,10 @@
#ifdef BB_FEATURE_SH_COMMAND_EDITING #ifdef BB_FEATURE_SH_COMMAND_EDITING
#ifndef BB_FEATURE_SH_TAB_COMPLETION #ifndef BB_FEATURE_SH_TAB_COMPLETION
#undef BB_FEATURE_USERNAME_COMPLETION #undef BB_FEATURE_SH_USERNAME_COMPLETION
#endif #endif
#if defined(BB_FEATURE_USERNAME_COMPLETION) || defined(BB_FEATURE_BASH_STYLE_PROMT) #if defined(BB_FEATURE_SH_USERNAME_COMPLETION) || defined(BB_FEATURE_BASH_STYLE_PROMT)
#define BB_FEATURE_GETUSERNAME_AND_HOMEDIR #define BB_FEATURE_GETUSERNAME_AND_HOMEDIR
#endif #endif
@ -626,7 +622,7 @@ static int is_execute(const struct stat *st)
return FALSE; return FALSE;
} }
#ifdef BB_FEATURE_USERNAME_COMPLETION #ifdef BB_FEATURE_SH_USERNAME_COMPLETION
static char **username_tab_completion(char *ud, int *num_matches) static char **username_tab_completion(char *ud, int *num_matches)
{ {
@ -688,7 +684,7 @@ static char **username_tab_completion(char *ud, int *num_matches)
return (matches); return (matches);
} }
} }
#endif /* BB_FEATURE_USERNAME_COMPLETION */ #endif /* BB_FEATURE_SH_USERNAME_COMPLETION */
enum { enum {
FIND_EXE_ONLY = 0, FIND_EXE_ONLY = 0,
@ -785,7 +781,7 @@ static char **exe_n_cwd_tab_completion(char *command, int *num_matches,
strcpy(dirbuf, command); strcpy(dirbuf, command);
/* set dir only */ /* set dir only */
dirbuf[(pfind - command) + 1] = 0; dirbuf[(pfind - command) + 1] = 0;
#ifdef BB_FEATURE_USERNAME_COMPLETION #ifdef BB_FEATURE_SH_USERNAME_COMPLETION
if (dirbuf[0] == '~') /* ~/... or ~user/... */ if (dirbuf[0] == '~') /* ~/... or ~user/... */
username_tab_completion(dirbuf, 0); username_tab_completion(dirbuf, 0);
#endif #endif
@ -1066,7 +1062,7 @@ static void input_tab(int *lastWasTab)
/* Free up any memory already allocated */ /* Free up any memory already allocated */
input_tab(0); input_tab(0);
#ifdef BB_FEATURE_USERNAME_COMPLETION #ifdef BB_FEATURE_SH_USERNAME_COMPLETION
/* If the word starts with `~' and there is no slash in the word, /* If the word starts with `~' and there is no slash in the word,
* then try completing this word as a username. */ * then try completing this word as a username. */