[ale] php-cli text input

Michael B. Trausch mike at trausch.us
Fri Nov 18 09:48:57 EST 2011


Set the default value, and prompt the user using a prompt that indicates the default, such as:

Save file as? [yourfile.txt] _

Which works well in that type of environment. If you want to get fancier, you can, but you will be doing more mucking about with the terminal to do what you want.
-- 
Sent from my Kindle Fire.

David Hamm <ale at spinnerdog.com> wrote:

Hi,

In php-cli, I'm looking for a way to allow a terminal user to edit a file name 
before saving it. The program should prompt the user like this.

Save file as: yourfile.txt

And the user should be able to edit the name of the file.

I've looked at readline() but readline doesn't let you set an initial/default 
value. I've also tried to find a way to push the default value into the 
keyboard buffer but no luck. 

Does anyone have any ideas?
_____________________________________________

Ale mailing list
Ale at ale.org
http://mail.ale.org/mailman/listinfo/ale
See JOBS, ANNOUNCE and SCHOOLS lists at
http://mail.ale.org/mailman/listinfo

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.ale.org/pipermail/ale/attachments/20111118/21a1355b/attachment.html 


More information about the Ale mailing list