Prettier output from start and status commands

This commit is contained in:
Chris 2022-10-13 23:18:28 +02:00
parent 1572c120f5
commit 72c2f36434
2 changed files with 5 additions and 5 deletions

View File

@ -43,11 +43,11 @@ class StartCommand extends Command
$info = $containerManager->startService($serviceInfo, $options);
$output->writeln("Started <fg=cyan>{$serviceName}</>[<fg=cyan>{$instanceName}</>]");
$output->writeln("Started <fg=cyan;options=bold>{$serviceName}</>[<fg=cyan>{$instanceName}</>]");
foreach ($info['ports'] as $info=>$port) {
$output->writeln(" <info>{$info}</>: <comment>{$port}</comment>");
}
return self::SUCCESS;
}
}
}

View File

@ -34,7 +34,7 @@ class StatusCommand extends Command
$table = new Table($output);
$table->setStyle('compact');
$table->setHeaders([ "Service", "Instance", "Purpose", "Port" ]);
$table->setHeaders([ "Service", "Instance", "Port", "" ]);
$running = $containerManager->getRunningServices();
$s = 0;
@ -42,7 +42,7 @@ class StatusCommand extends Command
$s++;
$i = 0;
foreach ($service['ports'] as $portInfo=>$portNumber) {
$table->addRow([ ($i==0)?$service['service']['name']:"", ($i==0)?$service['instance']:"", $portInfo, $portNumber ]);
$table->addRow([ "<fg=cyan;options=bold>".(($i==0)?$service['service']['name']:"")."</>", "<fg=cyan>".(($i==0)?$service['instance']:"")."</>", "<fg=yellow>".$portNumber."</>", $portInfo ]);
$i++;
}
}
@ -51,4 +51,4 @@ class StatusCommand extends Command
return self::SUCCESS;
}
}
}