Jump to content

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.