Fix CS
[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->description = 'List all connections';
15         $cmd->addOption(
16             'verbose',
17             array(
18                 'short_name'  => '-v',
19                 'long_name'   => '--verbose',
20                 'description' => 'Show more server infos',
21                 'action'      => 'StoreTrue',
22                 'default'     => false,
23             )
24         );
25     }
26
27     public function run($verbose)
28     {
29         foreach ($this->cfg->hosts as $key => $host) {
30             Log::msg($key);
31             if ($verbose) {
32                 Log::msg('  URL:  ' . $host->server);
33                 Log::msg('  User: ' . $host->user);
34             }
35         }
36     }
37 }
38 ?>