[PATCH] ash: perform autocompletion on builtin commands

Matteo Croce matteo at openwrt.org
Mon Dec 1 09:10:29 UTC 2014


2014-11-28 21:54 GMT+01:00 Denys Vlasenko <vda.linux at googlemail.com>:
> I would propose a different implementation, something like
> attached patch.
>
> However, the problem is:
>
> complete_cmd_dir_file                                773     895    +122
> preadbuffer                                          516     562     +46
> ------------------------------------------------------------------------------
> (add/remove: 0/0 grow/shrink: 2/0 up/down: 168/0)             Total: 168 bytes
>
>
> This looks largish, considering that shell builtins are not
> exactly such a long commands so that you'd often want
> to use tab completion:
>
>     . : [ [[ alias bg break cd chdir command continue echo eval exec
>     exit export false fg getopts hash help history jobs kill let
>     local printf pwd read readonly return set shift source test times
>     trap true type ulimit umask unalias unset wait
>
> They seem to mostly fall into two categories: (1) short coammnds
> like "cd", "fg" or "kill", and (2) rarely interactively used commands
> (do you ever use "continue" on command line? "getopts"?).
>
> Who feels this addition is useful?

Nice patch.
"echo eval exec history jobs kill" are often used in interactive shells,
and they are completed in other more complex shells like bash


More information about the busybox mailing list