Skip to content

Commit 5e8de15

Browse files
added command descriptions
1 parent 8d80467 commit 5e8de15

File tree

4 files changed

+43
-12
lines changed

4 files changed

+43
-12
lines changed

src/Command/DebugTasksCommand.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,16 @@ public function __construct($name, TaskExecutionRepositoryInterface $taskExecuti
4545
protected function configure()
4646
{
4747
$this->setDescription('Debug tasks')
48-
->addOption('page', 'p', InputOption::VALUE_REQUIRED, '', 1)
49-
->addOption('page-size', null, InputOption::VALUE_REQUIRED, '', null);
48+
->setHelp(<<<'EOT'
49+
The <info>%command.name%</info> command dumps the information about tasks.
50+
51+
$ %command.full_name% -p 1 --page-size 10
52+
53+
Pagination is possible with the optional options 'p' and 'page-size'.
54+
EOT
55+
)
56+
->addOption('page', 'p', InputOption::VALUE_REQUIRED, 'Specifies page for pagination', 1)
57+
->addOption('page-size', null, InputOption::VALUE_REQUIRED, 'Specifies page-size for pagination', null);
5058
}
5159

5260
/**

src/Command/RunCommand.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,14 @@ public function __construct($name, TaskRunnerInterface $runner, TaskSchedulerInt
5050
*/
5151
protected function configure()
5252
{
53-
$this->setDescription('Run pending tasks');
53+
$this->setDescription('Run pending tasks')
54+
->setHelp(<<<'EOT'
55+
The <info>%command.name%</info> command runs the pending task-executions. During the execution the status
56+
of the executions will be updated.
57+
58+
$ %command.full_name%
59+
EOT
60+
);
5461
}
5562

5663
/**

src/Command/RunHandlerCommand.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,15 @@ public function __construct($name, TaskHandlerFactoryInterface $handlerFactory)
4444
protected function configure()
4545
{
4646
$this
47-
->setDescription('Run pending tasks')
48-
->addArgument('handlerClass', InputArgument::REQUIRED)
49-
->addArgument('workload', InputArgument::OPTIONAL);
47+
->setDescription('Run handler')
48+
->setHelp(<<<'EOT'
49+
The <info>%command.name%</info> command run given handler.
50+
51+
$ %command.full_name% AppBundle\\Handler\\ImageHandler ./img/test-image.jpg
52+
EOT
53+
)
54+
->addArgument('handlerClass', InputArgument::REQUIRED, 'Handler which will be called')
55+
->addArgument('workload', InputArgument::OPTIONAL, 'This will be passed to the handler');
5056
}
5157

5258
/**

src/Command/ScheduleTaskCommand.php

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,22 @@ public function __construct($name, TaskSchedulerInterface $runner)
4545
protected function configure()
4646
{
4747
$this
48-
->setDescription('Run pending tasks')
49-
->addArgument('handlerClass', InputArgument::REQUIRED)
50-
->addArgument('workload', InputArgument::OPTIONAL)
51-
->addOption('cron-expression', 'c', InputOption::VALUE_REQUIRED)
52-
->addOption('execution-date', null, InputOption::VALUE_REQUIRED)
53-
->addOption('end-date', null, InputOption::VALUE_REQUIRED);
48+
->setDescription('Schedule task')
49+
->setHelp(<<<'EOT'
50+
The <info>%command.name%</info> command schedules given handler.
51+
52+
$ %command.full_name% AppBundle\\Handler\\ImageHandler
53+
54+
Execute without any arguments in order to see schedule a single task, use the
55+
<comment>--workload</comment> option in order to specify a workload or
56+
<comment>--cron-expression</comment> to create a recurring task.
57+
EOT
58+
)
59+
->addArgument('handlerClass', InputArgument::REQUIRED, 'Handler which will be called')
60+
->addArgument('workload', InputArgument::OPTIONAL, 'This will be passed to the handler')
61+
->addOption('cron-expression', 'c', InputOption::VALUE_REQUIRED, 'Specifies interval for recurring task')
62+
->addOption('execution-date', null, InputOption::VALUE_REQUIRED, 'Specifies execution-date for single task')
63+
->addOption('end-date', null, InputOption::VALUE_REQUIRED, 'Specifies last run date for recurring tasks');
5464
}
5565

5666
/**

0 commit comments

Comments
 (0)