KnpLabs/KnpConsoleAutocompleteBundle — Issue #15: Default to normal completion
Author: mrmark
Created: 2012-01-20 19:00:48+00:00
State: open

Hi there,

I love this innovative bundle, thank you!

One thing though that I didn't like about the autocomplete though, is that once you started to autocomplete with files/directories, it wouldn't end the autocomplete with a forward slash, but rather with a space. This made if very difficult to autocomplete down a directory tree.

http://www.debian-administration.org/articles/317#comment_16

You can actually accomplish default autocompletion very easily. Just change your complete command from the above comment at the end of the bash script. You also need to "return 1" like so:

``` bash
if [[ ${COMP_CWORD} > 1 ]] ; then
case "${cur}" in
--*)
COMPREPLY=( $(compgen -W "$(${cmd} autocomplete ${COMP_WORDS[1]})" -- ${cur}) )
return 0
;;
*)
return 1
;;
esac
fi
```