Hey guys, I'm writing a simple script to autocomplete when I press TAB.
The php script contains a simple "echo".
In this case, the autocomplete works but a "tab" is appended to the output making it useless
Code from the script
scriptPath='/home/hassen/workspace/scripts/bin/test.php'
_dda()
{
local cur
COMPREPLY=()
unset COMP_WORDS[0] #remove "j" from the array
cur=${COMP_WORDS[*]}
IFS=$'\n\n' read -d '' -a COMPREPLY < <($scriptPath --completion "$cur")
return 0
}
complete -F _dda dda
alias dda=$scriptPath
Code from php script
<?php
echo "hello";
?>
Here is the annoying part: If I print the echo in Python or Ruby, it works like a charm -- ie each time I press TAB, it calls the scripts and output hello.
Is this a bug with PHP or my code? They seem to disagree at http://bugs.php.net/bug.php?id=52755