diff --git a/core/completion.py b/core/completion.py index 56c7322de..702c23a9d 100755 --- a/core/completion.py +++ b/core/completion.py @@ -631,6 +631,10 @@ def Matches(self, comp): self.func.name) return + elif case(value_e.Str): + val = cast(value.Str, UP_val) + strs = [val.s] + elif case(value_e.BashArray): val = cast(value.BashArray, UP_val) strs = bash_impl.BashArray_GetValues(val) diff --git a/spec/builtin-completion.test.sh b/spec/builtin-completion.test.sh index bb7c24b90..504881136 100644 --- a/spec/builtin-completion.test.sh +++ b/spec/builtin-completion.test.sh @@ -594,3 +594,16 @@ bar compgen=0 complete=0 ## END + + +#### compgen -F with scalar COMPREPLY + +_comp_cmd_test() { + unset -v COMPREPLY + COMPREPLY=hello +} +compgen -F _comp_cmd_test + +## STDOUT: +hello +## END