Half person, half home automation, an under loved blog for all things Ruby, python and more in Adelaide
You can get partial readline support for Windows (no completion callback, or at least I haven't figured that part out yet) with http://gnuwin32.sourceforge.net/packages/readline.htm and FFI:$rl = new FFI("[lib='readline5.dll'] char *readline(char *prompt); void add_history(char *line);");while(true) { $line = $rl->readline('prompt ->'); $rl->add_history($line); print "[$line]\n"; if ($line == 'quit') { exit; }}
Post a Comment
1 comment:
You can get partial readline support for Windows (no completion callback, or at least I haven't figured that part out yet) with http://gnuwin32.sourceforge.net/packages/readline.htm and FFI:
$rl = new FFI("
[lib='readline5.dll']
char *readline(char *prompt);
void add_history(char *line);
");
while(true) {
$line = $rl->readline('prompt ->');
$rl->add_history($line);
print "[$line]\n";
if ($line == 'quit') { exit; }
}
Post a Comment