Bug #52755 [Opn->Bgs]: Command line is appending a tab when using bash autocompletion via a php script

From: Date: Wed, 01 Sep 2010 04:27:12 +0000
Subject: Bug #52755 [Opn->Bgs]: Command line is appending a tab when using bash autocompletion via a php script
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-153993@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=52755&edit=1

 ID:                 52755
 Updated by:         aharvey@php.net
 Reported by:        hassenbentanfous at gmail dot com
 Summary:            Command line is appending a tab when using bash
                     autocompletion via a php script
-Status:             Open
+Status:             Bogus
 Type:               Bug
 Package:            Output Control
 Operating System:   Ubuntu hardy linux 2.6
 PHP Version:        5.2.14
 Block user comment: N

 New Comment:

Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system
is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.




Previous Comments:
------------------------------------------------------------------------
[2010-08-31 23:19:10] hassenbentanfous at gmail dot com

Description:
------------
In order to write a bash autocompletion program using php, you need two

simple files.

1. bash script
2. php file processing the command and printing it

In this case, the autocomplete works but a "tab" is appended to the
output 
making it useless

The php script contains a simple "echo".
If I print the echo in python or ruby, it works properly (no tabs
appended) and 
each time I press tab the command is printed.
That's how it should work for php as well.

Test 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

----
test.php

<?php
echo "hello";
?>

Expected result:
----------------
"hello" should be appended each time I press "TAB"

Actual result:
--------------
Tabs are appended


------------------------------------------------------------------------



-- 
Edit this bug report at http://bugs.php.net/bug.php?id=52755&edit=1


Thread (2 messages)

« previous php.bugs (#153993) next »