Jump to content

PHP CLI script interactive utility??


zetharx

Recommended Posts

I am trying to find if PHP can possibly support this.  I want to have some PHP script which will create some interactive behavior much like bash.

 

for example

 

$ sudo apt

When I  hit <tab> twice, I'll get all the possible completions.

 

$ sudo apt
apt                           apt-get
apt-add-repository            aptitude
apt-cache                     aptitude-create-state-bundle
apt-cdrom                     aptitude-run-state-bundle
apt-config                    apt-key
aptd                          apt-mark
aptdcon                       apt-sortpkgs
apt-extracttemplates          apturl
apt-ftparchive                apturl-gtk

 

and likewise

 

$ sudo apt-g

<tab> once will auto-complete the only available command

 

$ sudo apt-get 

 

Is it possible to get PHP watching the input on the command line and reacting to <tab> with similar behavior?  Thanks in advance.

Link to comment
https://forums.phpfreaks.com/topic/203002-php-cli-script-interactive-utility/
Share on other sites

Umm, mattal999, he is talking about the CLI (Command Line Interface) this is seperate from the PHP / Webserver.

 

To answer your question zethrax, no you cannot. As those programs are coded into the kernel and programmed to be triggered with the tab. If, however, you really want this feature, you can compile the kernel with your program and auto-completeion items for the tab when that command is in the shell.

 

But other then that I know of no means to do what you are wanting.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.