Skip to content

Commit

Permalink
Fixed input argument bug
Browse files Browse the repository at this point in the history
  • Loading branch information
freestream committed Oct 19, 2020
1 parent ed0e92a commit 4e27e6f
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions Console/Command/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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();
}
Expand Down

0 comments on commit 4e27e6f

Please sign in to comment.