Commit ba187cf5 authored by Guillaume Perréal's avatar Guillaume Perréal

Ajout d'une commande pour lister les graphes configurés.

parent 5ef6f6b1
<?php declare(strict_types=1);
/**
* Copyright (C) 2019 IRSTEA
* All rights reserved.
*
* @copyright 2019 IRSTEA
* @author guillaume.perreal
*/
namespace Irstea\PlantUmlBundle\Command;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
/**
* Class ListCommand
*/
class ListCommand extends Command
{
/**
* @var string
*/
private const CMD_NAME = 'irstea:plantuml:list';
/**
* @var string[]
*/
private $graphNames;
/**
* ListCommand constructor.
* @param string[] $graphNames
*/
public function __construct(array $graphNames)
{
parent::__construct(self::CMD_NAME);
$this->graphNames = $graphNames;
}
/**
* {@inheritDoc}
*/
protected function configure()
{
$this
->setName(self::CMD_NAME)
->setDescription('Liste les graphes PlantUML configurés.');
}
/**
* {@inheritDoc}
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
foreach ($this->graphNames as $name) {
$output->writeln($name);
}
return 0;
}
}
......@@ -90,3 +90,12 @@ services:
public: false
tags:
- { name: console.command }
irstea.plant_uml.command.list:
class: Irstea\PlantUmlBundle\Command\ListCommand
lazy: true
public: false
tags:
- { name: console.command }
arguments:
- '%irstea_plant_uml.graph_keys%'
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment