mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-26 23:34:08 +02:00
Allow 'false' lookup components, improve help
This commit is contained in:
parent
b6ee15a37f
commit
88223acc47
@ -19,10 +19,12 @@ class Documentation
|
|||||||
|
|
||||||
public function usage($module = null, $command = null, $action = null)
|
public function usage($module = null, $command = null, $action = null)
|
||||||
{
|
{
|
||||||
if ($module !== null) {
|
if ($module) {
|
||||||
|
$module = $this->loader->resolveModuleName($module);
|
||||||
return $this->moduleUsage($module, $command, $action);
|
return $this->moduleUsage($module, $command, $action);
|
||||||
}
|
}
|
||||||
if ($command !== null) {
|
if ($command) {
|
||||||
|
$command = $this->loader->resolveCommandName($command);
|
||||||
return $this->commandUsage($command, $action);
|
return $this->commandUsage($command, $action);
|
||||||
}
|
}
|
||||||
return $this->globalUsage();
|
return $this->globalUsage();
|
||||||
@ -47,6 +49,7 @@ class Documentation
|
|||||||
$d .= "\nGlobal options:\n\n"
|
$d .= "\nGlobal options:\n\n"
|
||||||
. " --verbose Be verbose\n"
|
. " --verbose Be verbose\n"
|
||||||
. " --debug Show debug output\n"
|
. " --debug Show debug output\n"
|
||||||
|
. " --help Show help\n"
|
||||||
. " --benchmark Show benchmark summary\n"
|
. " --benchmark Show benchmark summary\n"
|
||||||
. " --watch [s] Refresh output each <s> seconds (default: 5)\n"
|
. " --watch [s] Refresh output each <s> seconds (default: 5)\n"
|
||||||
;
|
;
|
||||||
@ -77,6 +80,7 @@ class Documentation
|
|||||||
} elseif ($action === null) {
|
} elseif ($action === null) {
|
||||||
$d .= $this->showCommandActions($obj, $command);
|
$d .= $this->showCommandActions($obj, $command);
|
||||||
} else {
|
} else {
|
||||||
|
$action = $this->loader->resolveObjectActionName($obj, $action);
|
||||||
$d .= $this->getMethodDocumentation($obj, $action);
|
$d .= $this->getMethodDocumentation($obj, $action);
|
||||||
}
|
}
|
||||||
return $d;
|
return $d;
|
||||||
@ -101,11 +105,13 @@ class Documentation
|
|||||||
public function commandUsage($command, $action = null)
|
public function commandUsage($command, $action = null)
|
||||||
{
|
{
|
||||||
$obj = $this->loader->getCommandInstance($command);
|
$obj = $this->loader->getCommandInstance($command);
|
||||||
|
$action = $this->loader->resolveObjectActionName($obj, $action);
|
||||||
|
|
||||||
$d = "\n";
|
$d = "\n";
|
||||||
if ($action === null) {
|
if ($action) {
|
||||||
$d .= $this->showCommandActions($obj, $command);
|
|
||||||
} else {
|
|
||||||
$d .= $this->getMethodDocumentation($obj, $action);
|
$d .= $this->getMethodDocumentation($obj, $action);
|
||||||
|
} else {
|
||||||
|
$d .= $this->showCommandActions($obj, $command);
|
||||||
}
|
}
|
||||||
return $d;
|
return $d;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user