Set default command

This commit is contained in:
Oliver Davies 2018-01-10 23:52:22 +00:00
parent fc629ead56
commit 99caed2737
3 changed files with 6 additions and 2 deletions

View file

@ -1,5 +1,6 @@
<?php
use Opdavies\GmailFilterBuilder\Console\Command\GenerateCommand;
use Opdavies\GmailFilterBuilder\Container\Container;
use Symfony\Component\Console\Application;
@ -9,4 +10,5 @@ $container = new Container();
/** @var Application $application */
$application = $container->get('app.cli');
$application->setDefaultCommand(GenerateCommand::NAME);
$application->run();

View file

@ -3,7 +3,7 @@ services:
class: Symfony\Component\Console\Application
autowire: true
app.generator.command:
app.generate.command:
class: Opdavies\GmailFilterBuilder\Console\Command\GenerateCommand
autowire: true
tags:

View file

@ -10,13 +10,15 @@ use Symfony\Component\Console\Output\OutputInterface;
class GenerateCommand extends Command
{
const NAME = 'generate';
/**
* {@inheritdoc}
*/
public function configure()
{
$this
->setName('generate')
->setName(self::NAME)
->setDefinition([
new InputArgument('input-file', InputArgument::OPTIONAL, 'The name of the PHP file containing your filters.', 'filters.php'),
new InputArgument('output-file', InputArgument::OPTIONAL, 'The name of the XML file to generate.', 'filters.xml')