OSDN Git Service

Exit on end-of-file
authorNikolay Bachiyski <nb@nikolay.bg>
Thu, 14 Feb 2013 14:28:40 +0000 (16:28 +0200)
committerNikolay Bachiyski <nb@nikolay.bg>
Thu, 14 Feb 2013 14:28:40 +0000 (16:28 +0200)
commite5433ecaf4b838a589560c25cb960de4a89333c8
treef733721162f85237f27ca059f2db153e45510e65
parent478d21235b0deeda574f5666e0bf2903ce6f2b7b
Exit on end-of-file

It's a common practice shells to exit on end-of-file. WP-CLI doesn't do
this.

I traced the reason to the fact we're not checking the exit code from
the `read` builtin. If it timeouts or receives end-of-file, it's
non-zero. In both these cases it makes sense to exit.
php/commands/shell.php