Skip to content

Commit

Permalink
Rebuilding...
Browse files Browse the repository at this point in the history
  • Loading branch information
kohkimakimoto committed Oct 13, 2014
1 parent f27c542 commit 1a7c1f9
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 8 deletions.
25 changes: 19 additions & 6 deletions src/Altax/Command/Builtin/TasksCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,29 @@ protected function execute(InputInterface $input, OutputInterface $output)
->setCellRowContentFormat("%s ")
;
$table->setStyle($style);

if ('txt-no-header' !== $format) {
$table->setHeaders(array('name', 'description', 'hidden'));
if ($output->isVerbose()) {
$table->setHeaders(array('name', 'description', 'hidden'));
} else {
$table->setHeaders(array('name', 'description'));
}
}

foreach ($tasks as $task) {
$command = $task->makeCommand();
$table->addRow(array(
$task->getName(),
$command->getDescription(),
$task->isHidden() ? 'X' : '',
));
if ($output->isVerbose()) {
$table->addRow(array(
$task->getName(),
$command->getDescription(),
$task->isHidden() ? 'X' : '',
));
} else {
$table->addRow(array(
$task->getName(),
$command->getDescription(),
));
}
}

$table->render($output);
Expand Down
4 changes: 2 additions & 2 deletions tests/Altax/Command/Builtin/TasksCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ public function testDefault()
);

$expected = <<<EOL
name description hidden
test
name description
test
EOL;
$this->assertEquals($expected, $commandTester->getDisplay());
Expand Down

0 comments on commit 1a7c1f9

Please sign in to comment.