use default host if none given
[shpub.git] / src / shpub / Cli.php
index 62f824ee92546455cb309219983b63372d4f3ee1..44cf8c86744ecaf7b149a1b3039cd3026ed4b69e 100644 (file)
@@ -79,6 +79,11 @@ class Cli
                 } else {
                     $this->cfg->host = $this->cfg->hosts[$key];
                 }
+            } else {
+                $key = $this->cfg->getDefaultHost();
+                if ($key !== null) {
+                    $this->cfg->host = $this->cfg->hosts[$key];
+                }
             }
             if ($opts['user'] !== null) {
                 $this->cfg->host->user = $opts['user'];