diff options
author | Ron Yorston <rmy@pobox.com> | 2023-04-10 10:20:15 +0100 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2023-04-10 11:45:46 +0100 |
commit | 66c9b8f39acbba587eda0cababa3de37e89b8dff (patch) | |
tree | 732e6265edfd8e3a627c29f2b10410c9fa789ca6 /include | |
parent | 3165054d234e0f37f1a230312f1fd2ab3677bbc0 (diff) | |
download | busybox-w32-66c9b8f39acbba587eda0cababa3de37e89b8dff.tar.gz busybox-w32-66c9b8f39acbba587eda0cababa3de37e89b8dff.tar.bz2 busybox-w32-66c9b8f39acbba587eda0cababa3de37e89b8dff.zip |
ash,hush: tab completion of functions and aliases
Rework the 'get_exe_name' functions in ash and hush so functions
and aliases are considered when tab-completing a command.
function old new delta
ash_command_name - 188 +188
hush_command_name - 118 +118
complete_cmd_dir_file 876 880 +4
ash_builtin_name 17 - -17
hush_builtin_name 38 - -38
------------------------------------------------------------------------------
(add/remove: 2/2 grow/shrink: 1/0 up/down: 310/-55) Total: 255 bytes
(GitHub issue #301)
Signed-off-by: Ron Yorston <rmy@pobox.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/libbb.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/include/libbb.h b/include/libbb.h index 6191debb1..66781da4f 100644 --- a/include/libbb.h +++ b/include/libbb.h | |||
@@ -1924,7 +1924,14 @@ unsigned size_from_HISTFILESIZE(const char *hp) FAST_FUNC; | |||
1924 | # else | 1924 | # else |
1925 | # define MAX_HISTORY 0 | 1925 | # define MAX_HISTORY 0 |
1926 | # endif | 1926 | # endif |
1927 | typedef const char *get_exe_name_t(int i) FAST_FUNC; | 1927 | typedef struct exe_state { |
1928 | int e_type; /* type of tab completion: builtin, alias, function */ | ||
1929 | int e_index; /* index of current table entry or hash bucket */ | ||
1930 | # if ENABLE_SHELL_ASH || (ENABLE_SHELL_HUSH && ENABLE_HUSH_FUNCTIONS) | ||
1931 | void *e_ptr; /* current position in linked list */ | ||
1932 | # endif | ||
1933 | } exe_state; | ||
1934 | typedef const char *get_exe_name_t(exe_state *e) FAST_FUNC; | ||
1928 | typedef const char *sh_get_var_t(const char *name) FAST_FUNC; | 1935 | typedef const char *sh_get_var_t(const char *name) FAST_FUNC; |
1929 | typedef struct line_input_t { | 1936 | typedef struct line_input_t { |
1930 | int flags; | 1937 | int flags; |