Add check for 0 hosts

This commit is contained in:
Anton Medvedev 2017-04-07 01:27:24 +07:00
parent 7f74425d88
commit e58af6fe28

View File

@ -62,7 +62,10 @@ class SshCommand extends Command
return !($host instanceof Localhost);
});
if (count($hosts) === 1) {
if (count($hosts) === 0) {
$output->writeln('No remote hosts.');
return; // Because there are no hosts.
} else if (count($hosts) === 1) {
$host = array_shift($hosts);
} else {
$helper = $this->getHelper('question');