diff --git a/src/Command/DebugTasksCommand.php b/src/Command/DebugTasksCommand.php index 5dfbe52..9cafb91 100644 --- a/src/Command/DebugTasksCommand.php +++ b/src/Command/DebugTasksCommand.php @@ -45,8 +45,16 @@ public function __construct($name, TaskExecutionRepositoryInterface $taskExecuti protected function configure() { $this->setDescription('Debug tasks') - ->addOption('page', 'p', InputOption::VALUE_REQUIRED, '', 1) - ->addOption('page-size', null, InputOption::VALUE_REQUIRED, '', null); + ->setHelp(<<<'EOT' +The %command.name% command dumps the information about tasks. + + $ %command.full_name% -p 1 --page-size 10 + +Pagination is possible with the optional options 'p' and 'page-size'. +EOT + ) + ->addOption('page', 'p', InputOption::VALUE_REQUIRED, 'Specifies page for pagination', 1) + ->addOption('page-size', null, InputOption::VALUE_REQUIRED, 'Specifies page-size for pagination', null); } /** diff --git a/src/Command/RunCommand.php b/src/Command/RunCommand.php index f496513..6535b35 100644 --- a/src/Command/RunCommand.php +++ b/src/Command/RunCommand.php @@ -50,7 +50,14 @@ public function __construct($name, TaskRunnerInterface $runner, TaskSchedulerInt */ protected function configure() { - $this->setDescription('Run pending tasks'); + $this->setDescription('Run pending tasks') + ->setHelp(<<<'EOT' +The %command.name% command runs the pending task-executions. During the execution the status +of the executions will be updated. + + $ %command.full_name% +EOT + ); } /** diff --git a/src/Command/RunHandlerCommand.php b/src/Command/RunHandlerCommand.php index d265178..e851027 100644 --- a/src/Command/RunHandlerCommand.php +++ b/src/Command/RunHandlerCommand.php @@ -44,9 +44,15 @@ public function __construct($name, TaskHandlerFactoryInterface $handlerFactory) protected function configure() { $this - ->setDescription('Run pending tasks') - ->addArgument('handlerClass', InputArgument::REQUIRED) - ->addArgument('workload', InputArgument::OPTIONAL); + ->setDescription('Run handler') + ->setHelp(<<<'EOT' +The %command.name% command run given handler. + + $ %command.full_name% AppBundle\\Handler\\ImageHandler ./img/test-image.jpg +EOT + ) + ->addArgument('handlerClass', InputArgument::REQUIRED, 'Handler which will be called') + ->addArgument('workload', InputArgument::OPTIONAL, 'This will be passed to the handler'); } /** diff --git a/src/Command/ScheduleTaskCommand.php b/src/Command/ScheduleTaskCommand.php index 837919c..40b4b54 100644 --- a/src/Command/ScheduleTaskCommand.php +++ b/src/Command/ScheduleTaskCommand.php @@ -45,12 +45,22 @@ public function __construct($name, TaskSchedulerInterface $runner) protected function configure() { $this - ->setDescription('Run pending tasks') - ->addArgument('handlerClass', InputArgument::REQUIRED) - ->addArgument('workload', InputArgument::OPTIONAL) - ->addOption('cron-expression', 'c', InputOption::VALUE_REQUIRED) - ->addOption('execution-date', null, InputOption::VALUE_REQUIRED) - ->addOption('end-date', null, InputOption::VALUE_REQUIRED); + ->setDescription('Schedule task') + ->setHelp(<<<'EOT' +The %command.name% command schedules given handler. + + $ %command.full_name% AppBundle\\Handler\\ImageHandler + +Execute without any arguments in order to see schedule a single task, use the +--workload option in order to specify a workload or +--cron-expression to create a recurring task. +EOT + ) + ->addArgument('handlerClass', InputArgument::REQUIRED, 'Handler which will be called') + ->addArgument('workload', InputArgument::OPTIONAL, 'This will be passed to the handler') + ->addOption('cron-expression', 'c', InputOption::VALUE_REQUIRED, 'Specifies interval for recurring task') + ->addOption('execution-date', null, InputOption::VALUE_REQUIRED, 'Specifies execution-date for single task') + ->addOption('end-date', null, InputOption::VALUE_REQUIRED, 'Specifies last run date for recurring tasks'); } /**