Make tab completion an option
authorErik Andersen <andersen@codepoet.org>
Sun, 9 Apr 2000 18:27:46 +0000 (18:27 -0000)
committerErik Andersen <andersen@codepoet.org>
Sun, 9 Apr 2000 18:27:46 +0000 (18:27 -0000)
 -Erik

busybox.def.h
cmdedit.c
shell/cmdedit.c

index cb864120b219019a69acd9fd983932f09df026f2..eebe9b973e6b6dce8fb394c65a450ad50ed59879 100644 (file)
 // 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
 //
index 2c16276db624505d2d208d2c2c17e6d0c74309f4..d15c694977ff28f746cf6723b6aae36b9ac04e1f 100644 (file)
--- a/cmdedit.c
+++ b/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 */
index 2c16276db624505d2d208d2c2c17e6d0c74309f4..d15c694977ff28f746cf6723b6aae36b9ac04e1f 100644 (file)
@@ -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 */