Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@naholyr
Created March 9, 2011 22:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save naholyr/863160 to your computer and use it in GitHub Desktop.
Save naholyr/863160 to your computer and use it in GitHub Desktop.
Stupid basic autocompletion, broken by PHP
_test_completion()
{
php -r "echo 'coucou';" > /dev/null # useless call to PHP
# Any call to PHP will make this occur: I was trying to parse the output of Symfony2's app/console
# and had a huge headache before I just made this test... and gave up.
COMPREPLY=( $(compgen -W "world myself everyone") )
}
complete -o default -F _test_completion hello
# Type "hello " (with the space) then press TAB twice, and you'll see:
# nothing but a fucking tab...
# This is a FAIL
_test_completion()
{
COMPREPLY=( $(compgen -W "world myself everyone") )
}
complete -o default -F _test_completion hello
# Type "hello " (with the space) then press TAB twice, and you'll see:
# everyone myself world
# This is OK
@naholyr
Copy link
Author

naholyr commented Mar 9, 2011

Reproduced bug on my desktop & server, both Ubuntu. I suppose this is related to Ubuntu's version of PHP ?

@naholyr
Copy link
Author

naholyr commented Mar 9, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment