Skip to content

Added command descriptions #32

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 5, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions src/Command/DebugTasksCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 <info>%command.name%</info> 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);
}

/**
Expand Down
9 changes: 8 additions & 1 deletion src/Command/RunCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 <info>%command.name%</info> command runs the pending task-executions. During the execution the status
of the executions will be updated.

$ %command.full_name%
EOT
);
}

/**
Expand Down
12 changes: 9 additions & 3 deletions src/Command/RunHandlerCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 <info>%command.name%</info> 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');
}

/**
Expand Down
22 changes: 16 additions & 6 deletions src/Command/ScheduleTaskCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 <info>%command.name%</info> command schedules given handler.

$ %command.full_name% AppBundle\\Handler\\ImageHandler

Execute without any arguments in order to see schedule a single task, use the
<comment>--workload</comment> option in order to specify a workload or
<comment>--cron-expression</comment> 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');
}

/**
Expand Down