Created
March 9, 2011 22:34
-
-
Save naholyr/863160 to your computer and use it in GitHub Desktop.
Stupid basic autocompletion, broken by PHP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Reproduced bug on my desktop & server, both Ubuntu. I suppose this is related to Ubuntu's version of PHP ?