Skip to content

Commit

Permalink
Import module 'conftool' for cli.
Browse files Browse the repository at this point in the history
Refs #5929
  • Loading branch information
Thomas-Gelf authored and Michael Friedrich committed Jun 10, 2014
1 parent 506cfe2 commit 89506c9
Show file tree
Hide file tree
Showing 23 changed files with 1,096 additions and 0 deletions.
19 changes: 19 additions & 0 deletions modules/conftool/application/clicommands/ParseCommand.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

namespace Icinga\Module\Conftool\Clicommands;

use Icinga\Cli\Command;
use Icinga\Module\Conftool\Icinga\IcingaConfig;
use Icinga\Module\Conftool\Icinga2\Icinga2Command;

class ParseCommand extends Command
{
public function v1Action()
{
$configfile = $this->params->shift();
$config = IcingaConfig::parse($configfile);
foreach ($config->getDefinitions('command') as $command) {
Icinga2Command::fromIcingaCommand($command)->dump();
}
}
}
8 changes: 8 additions & 0 deletions modules/conftool/library/Conftool/Icinga/IcingaCommand.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

namespace Icinga\Module\Conftool\Icinga;

class IcingaCommand extends IcingaObjectDefinition
{
protected $key = 'command_name';
}
Loading

0 comments on commit 89506c9

Please sign in to comment.