public function processCommand(CliEngine $engine, $params = array(), $additionalContext = null)
{
// shorthand
$runtimeConfig = $additionalContext->getRuntimeConfig();
// are there any hosts in the table?
if (!isset($runtimeConfig->storyplayer, $runtimeConfig->storyplayer->tables, $runtimeConfig->storyplayer->tables->hosts)) {
// we're done
return 0;
}
// let's walk through the table
foreach ($runtimeConfig->storyplayer->tables->hosts as $envName => $hosts) {
foreach ($hosts as $hostid => $details) {
// is this in the list we are filtering against?
if (!in_array(strtolower($details->type), $engine->options->hosttype)) {
continue;
}
echo "{$envName}:{$details->id}:{$details->ipAddress}:{$details->type}:{$details->osName}\n";
}
}
// all done
return 0;
}