Skip to content

Commit 3b549e7

Browse files
committed
Add repl flags -b and -r for boolean and raw modes
1 parent 2fcc668 commit 3b549e7

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

repl.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,13 @@ function format($result)
3434

3535
$mode = 'i';
3636

37+
foreach (['b', 'r'] as $flag) {
38+
if (in_array("-$flag", $argv, true)) {
39+
$mode = $flag;
40+
break;
41+
}
42+
}
43+
3744
while (prompt($mode) && false !== ($line = fgets(STDIN))) {
3845
$exp = trim($line);
3946

0 commit comments

Comments
 (0)