switch ($command) {
case 'config-show': {
$keys = $cf->getKeys();
+ sort($keys);
+ $this->ui->startTable(array('caption' => 'Configuration:'));
if (isset($params[0]) && $cf->isDefined($params[0])) {
foreach ($keys as $key) {
$type = $cf->getType($key);
- if ($type == 'password') {
- $this->ui->displayLine("$key = ********");
- } else {
- $this->ui->displayLine("$key = " . $cf->get($key, $params[0]));
+ $value = $cf->get($key, $params[0]);
+ if ($type == 'password' && $value) {
+ $value = '********';
}
+ $this->ui->tableRow(array($key, $value));
}
} else {
foreach ($keys as $key) {
$type = $cf->getType($key);
- if ($type == 'password') {
- $this->ui->displayLine("$key = ********");
- } else {
- $this->ui->displayLine("$key = " . $cf->get($key));
+ $value = $cf->get($key, $params[0]);
+ if ($type == 'password' && $value) {
+ $value = '********';
}
+ $this->ui->tableRow(array($key, $value));
}
}
+ $this->ui->endTable();
break;
}
case 'config-get': {