From 4e27e6ff69a664c0567d16a9873d8259ce5cd0d5 Mon Sep 17 00:00:00 2001 From: Anton Samuelsson Date: Mon, 19 Oct 2020 09:13:42 +0000 Subject: [PATCH] Fixed input argument bug --- Console/Command/Server.php | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/Console/Command/Server.php b/Console/Command/Server.php index d1d37fb..8c0c696 100644 --- a/Console/Command/Server.php +++ b/Console/Command/Server.php @@ -29,6 +29,7 @@ use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Input\InputDefinition; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Process\Exception\ProcessFailedException; @@ -183,13 +184,19 @@ protected function configure() $this->setName('pulchqueue:server'); $this->setDescription('Start queue server'); - $this->setDefinition([ - new InputArgument('name', InputArgument::OPTIONAL, ''), - new InputOption(self::ARGUMENT_THREADS, '-t', InputOption::VALUE_NONE, 'How many simultaneous threads?'), - new InputOption(self::ARGUMENT_POLL, '-p', InputOption::VALUE_NONE, 'How often to look for executable labours (sec)?'), - new InputOption(self::ARGUMENT_PLAN_AHEAD, '-a', InputOption::VALUE_NONE, 'Recurring - Plan minutes ahead?'), - new InputOption(self::ARGUMENT_RESOLUTION, '-r', InputOption::VALUE_NONE, 'Recurring - Resolution?'), - ]); + $this->setDefinition( + new InputDefinition([ + new InputOption(self::ARGUMENT_THREADS, 't', InputOption::VALUE_OPTIONAL), + new InputOption(self::ARGUMENT_POLL, 'p', InputOption::VALUE_OPTIONAL), + new InputOption(self::ARGUMENT_PLAN_AHEAD, 'a', InputOption::VALUE_OPTIONAL), + new InputOption(self::ARGUMENT_RESOLUTION, 'r', InputOption::VALUE_OPTIONAL), + ]) + ); + + $this->addArgument(self::ARGUMENT_THREADS, InputArgument::OPTIONAL, __('How many simultaneous threads?')); + $this->addArgument(self::ARGUMENT_POLL, InputArgument::OPTIONAL, __('How often to look for executable labours (sec)?')); + $this->addArgument(self::ARGUMENT_PLAN_AHEAD, InputArgument::OPTIONAL, __('Recurring - Plan minutes ahead?')); + $this->addArgument(self::ARGUMENT_RESOLUTION, InputArgument::OPTIONAL, __('Recurring - Resolution?')); parent::configure(); }