Add --dry-run option for getting curl commands
[shpub.git] / src / shpub / Config.php
index d41e45dc2a3495179fb797eb185d471a0b8e015f..f3ca5433d13a94904a6aeeae0148bafb28b9baf0 100644 (file)
@@ -12,6 +12,10 @@ class Config
      */
     public $host;
 
+    public $debug = false;
+
+    public $dryRun = false;
+
     protected function getConfigFilePath()
     {
         if (!isset($_SERVER['HOME'])) {
@@ -86,10 +90,10 @@ class Config
         }
         foreach ($this->hosts as $key => $host) {
             if ($host->default) {
-                return $host;
+                return $key;
             }
         }
-        
+
         reset($this->hosts);
         return key($this->hosts);
     }
@@ -114,5 +118,15 @@ class Config
         }
         return '"' . $val . '"';
     }
+
+    public function setDebug($debug)
+    {
+        $this->debug = $debug;
+    }
+
+    public function setDryRun($dryRun)
+    {
+        $this->dryRun = $dryRun;
+    }
 }
 ?>