mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-25 14:54:24 +02:00
Simplified help command, also does autocompletion right now
This commit is contained in:
parent
88223acc47
commit
724a57e93a
@ -3,6 +3,7 @@
|
|||||||
namespace Icinga\Clicommands;
|
namespace Icinga\Clicommands;
|
||||||
|
|
||||||
use Icinga\Cli\Command;
|
use Icinga\Cli\Command;
|
||||||
|
use Icinga\Cli\Loader;
|
||||||
use Icinga\Cli\Documentation;
|
use Icinga\Cli\Documentation;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -30,31 +31,12 @@ class HelpCommand extends Command
|
|||||||
$module = null;
|
$module = null;
|
||||||
$command = null;
|
$command = null;
|
||||||
$action = null;
|
$action = null;
|
||||||
$loader = $this->app->cliLoader();
|
$loader = new Loader($this->app);
|
||||||
$command = $this->params->shift();
|
$loader->parseParams();
|
||||||
|
echo $this->docs()->usage(
|
||||||
if ($loader->hasCommand($command)) {
|
$loader->getModuleName(),
|
||||||
$action = $this->params->shift();
|
$loader->getCommandName(),
|
||||||
if (! $loader->getCommandInstance($command)->hasActionName($action)) {
|
$loader->getActionName()
|
||||||
$action = null;
|
);
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if ($loader->hasModule($command)) {
|
|
||||||
$module = $command;
|
|
||||||
$command = $this->params->shift();
|
|
||||||
if ($loader->hasModuleCommand($module, $command)) {
|
|
||||||
$action = $this->params->shift();
|
|
||||||
$mod = $loader->getModuleCommandInstance($module, $command);
|
|
||||||
if (! $mod->hasActionName($action)) {
|
|
||||||
$action = null;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$command = null;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$command = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
echo $this->docs()->usage($module, $command, $action);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user