Merge pull request #2856 from Icinga/bugfix/wrong-help-text-in-the-icingacli-2801
Correct CLI help text for modules
This commit is contained in:
commit
d1debea048
|
@ -146,6 +146,16 @@ abstract class Command
|
|||
return $this->defaultActionName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get {@link moduleName}
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getModuleName()
|
||||
{
|
||||
return $this->moduleName;
|
||||
}
|
||||
|
||||
public function hasDefaultActionName()
|
||||
{
|
||||
return $this->hasActionName($this->defaultActionName);
|
||||
|
|
|
@ -91,6 +91,12 @@ class Documentation
|
|||
return $d;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Command $command
|
||||
* @param string $name
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function showCommandActions($command, $name)
|
||||
{
|
||||
$actions = $command->listActions();
|
||||
|
@ -103,7 +109,11 @@ class Documentation
|
|||
$this->getMethodTitle($command, $action)
|
||||
);
|
||||
}
|
||||
$d .= "\nShow help on a specific action: icingacli help $name <action>\n";
|
||||
$d .= "\nShow help on a specific action: icingacli help ";
|
||||
if ($command->isModule()) {
|
||||
$d .= $command->getModuleName() . ' ';
|
||||
}
|
||||
$d .= "$name <action>\n";
|
||||
return $d;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue