PHP
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

readline_info> <readline_clear_history
Last updated: Fri, 05 Sep 2008

view this page in

readline_completion_function

(PHP 4, PHP 5)

readline_completion_function補完関数を登録する

説明

bool readline_completion_function ( callback $function )

この関数は補完用の関数を登録します。 これは、Bash を使用している際に、タブキーを 押して得られるのと同様の機能です。

パラメータ

function

コマンドラインの一部を入力とし、 マッチする可能性がある文字列の配列を返す 既存の関数の名前を指定する必要があります。

返り値

成功した場合に TRUE を、失敗した場合に FALSE を返します。



add a note add a note User Contributed Notes
readline_completion_function
david at acz dot org
01-Feb-2005 09:08
This function can simply return an array of all possible matches (regardless of the current user intput) and readline will handle the matching itself.  This is likely to be much faster than attempting to handle partial matches in PHP.
john at weider dot cc
21-Sep-2002 06:32
It seems that the registered function can accept 2 parameters, the first being the partial string, the second a number that when equal to zero indicates that the tab was hit on the first argument on the input. Otherwise it looks like the position within the string is returned.

This is neccessary information for processing shell command line input.

readline_info> <readline_clear_history
Last updated: Fri, 05 Sep 2008
 
 
show source | credits | sitemap | contact | advertising | mirror sites