/** * {@inheritdoc} */ public function getHostList(InputInterface $input, OutputInterface $output) { $list = parent::getHostList($input, $output); if (is_array($list)) { foreach ($list as $key => $host) { /** @var \App\Service\Vagrant\Host $host */ # remove "poweroff" from the list if ($host->getData("state") == 'poweroff') { unset($list[$key]); } } } return $list; }
/** * {@inheritdoc} */ public function getHostList(InputInterface $input, OutputInterface $output) { $ignoreStatuses = array("saved", "poweroff"); $list = parent::getHostList($input, $output); if (is_array($list)) { foreach ($list as $key => $host) { /** @var \App\Service\Vagrant\Host $host */ # remove ignored from the list if (in_array($host->getData("state"), $ignoreStatuses)) { unset($list[$key]); } } } return $list; }
protected function configure() { parent::configure(); $this->setDescription("Start an ssh-session into a box"); $this->addOption('start', 's', InputOption::VALUE_NONE, 'Start the box if necessary'); }