diff options
author | Ron Yorston | 2020-01-21 16:01:58 +0000 |
---|---|---|
committer | Denys Vlasenko | 2020-01-29 15:23:17 +0100 |
commit | 9e2a5668fd38db169d9d91b13089a99df4c9bd37 (patch) | |
tree | 3d823cd22bf7627fbb5ef90fdcfae794c1f94ab2 /include | |
parent | 1ff7002b1d229c678fdffebec602fb4c54439a31 (diff) | |
download | busybox-9e2a5668fd38db169d9d91b13089a99df4c9bd37.zip busybox-9e2a5668fd38db169d9d91b13089a99df4c9bd37.tar.gz |
ash,hush: allow builtins to be tab-completed, closes 7532
function old new delta
complete_cmd_dir_file 678 830 +152
get_builtin_name - 35 +35
optschanged 125 132 +7
hush_main 1069 1076 +7
save_command_ps_at_cur_history 76 78 +2
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 4/0 up/down: 203/0) Total: 203 bytes
Signed-off-by: Ron Yorston <rmy@pobox.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/libbb.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/libbb.h b/include/libbb.h index 05a5609..392c044 100644 --- a/include/libbb.h +++ b/include/libbb.h @@ -1818,10 +1818,19 @@ unsigned size_from_HISTFILESIZE(const char *hp) FAST_FUNC; # else # define MAX_HISTORY 0 # endif +typedef const char *get_exe_name_t(int i) FAST_FUNC; typedef struct line_input_t { int flags; int timeout; const char *path_lookup; +# if ENABLE_FEATURE_TAB_COMPLETION \ +&& (ENABLE_ASH || ENABLE_SH_IS_ASH || ENABLE_BASH_IS_ASH \ +|| ENABLE_HUSH || ENABLE_SH_IS_HUSH || ENABLE_BASH_IS_HUSH \ +) + /* function to fetch additional application-specific names to match */ + get_exe_name_t *get_exe_name; +# define EDITING_HAS_get_exe_name 1 +# endif # if MAX_HISTORY int cnt_history; int cur_history; @@ -1868,6 +1877,10 @@ int read_line_input(const char* prompt, char* command, int maxsize) FAST_FUNC; read_line_input(prompt, command, maxsize) #endif +#ifndef EDITING_HAS_get_exe_name +# define EDITING_HAS_get_exe_name 0 +#endif + #ifndef COMM_LEN # ifdef TASK_COMM_LEN |