diff options
author | Ivan Enderlin <ivan.enderlin@hoa-project.net> | 2013-02-22 13:26:36 +0100 |
---|---|---|
committer | Ivan Enderlin <ivan.enderlin@hoa-project.net> | 2013-02-22 13:26:36 +0100 |
commit | 9f6490ca666f01f5c4e50a18faa1994b4e1460a4 (patch) | |
tree | 8d686e3490c5d14b05947da8fcfcb497b475b2da /Bin | |
parent | da19316b651c66ed01ea480582f7e4cbbdc6eefc (diff) | |
download | Praspel-9f6490ca666f01f5c4e50a18faa1994b4e1460a4.zip Praspel-9f6490ca666f01f5c4e50a18faa1994b4e1460a4.tar.gz Praspel-9f6490ca666f01f5c4e50a18faa1994b4e1460a4.tar.bz2 |
Stop to readline on EOF.
Add the short option .q to quit.
Diffstat (limited to 'Bin')
-rw-r--r-- | Bin/Shell.php | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Bin/Shell.php b/Bin/Shell.php index cbff9a4..a01f49f 100644 --- a/Bin/Shell.php +++ b/Bin/Shell.php @@ -174,7 +174,7 @@ class Shell extends \Hoa\Console\Dispatcher\Kit { ' .s[ample] to sample a value of a variable;', "\n", ' .u[nset] to unset a variable;', "\n", ' .d[ump] to dump the tree of the expression;', "\n", - ' .quit to quit.', "\n"; + ' .q[uit] to quit.', "\n"; break; case '.c': @@ -228,6 +228,10 @@ class Shell extends \Hoa\Console\Dispatcher\Kit { echo $dump->visit($interpreter->getRoot()); break; + case '.q': + case '.quit': + break 2; + default: if(null === $expression) break; @@ -248,7 +252,7 @@ class Shell extends \Hoa\Console\Dispatcher\Kit { echo "\n"; - } while('.quit' !== $expression = $readline->readLine('> ')); + } while(false !== $expression = $readline->readLine('> ')); return; } |