Add upload command
[shpub.git] / src / shpub / Command / Server.php
1 <?php
2 namespace shpub;
3
4 class Command_Server
5 {
6     public function __construct(Config $cfg)
7     {
8         $this->cfg = $cfg;
9     }
10
11     public static function opts(\Console_CommandLine $optParser)
12     {
13         $cmd = $optParser->addCommand('server');
14         $cmd->addOption(
15             'verbose',
16             array(
17                 'short_name'  => '-v',
18                 'long_name'   => '--verbose',
19                 'description' => 'Show more server infos',
20                 'action'      => 'StoreTrue',
21                 'default'     => false,
22             )
23         );
24     }
25
26     public function run($verbose)
27     {
28         foreach ($this->cfg->hosts as $key => $host) {
29             Log::msg($key);
30             if ($verbose) {
31                 Log::msg('  URL:  ' . $host->server);
32                 Log::msg('  User: ' . $host->user);
33             }
34         }
35     }
36 }
37 ?>