Daniel's collected open source and open data musings as a web developer, project manager and architect 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