Skip to content

Commit

Permalink
ListCommand: added shortcuts to options
Browse files Browse the repository at this point in the history
  • Loading branch information
mabar committed Dec 19, 2023
1 parent ea267e5 commit 9aea8e2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- `ListCommand`
- prints `repeatAfterSeconds` parameter
- prints job's `timeZone` parameter
- adds `timezone` option to show execution times in specified timezone
- adds `--timezone` (`-tz`) option to show execution times in specified timezone
- adds `-n` shortcut for `--next` option

### Changed

Expand Down
8 changes: 5 additions & 3 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -528,13 +528,15 @@ Run single job, ignoring scheduled time

### List command

List all scheduled jobs (in `expression / second [id] name... next-due` format)
List all scheduled jobs (in `expression / second (timezone) [id] name... next-due` format)

`bin/console scheduler:list`

- use `--next` to sort jobs by their next execution time
- `--next=N` lists only *N* next jobs (e.g. `--next=3` prints maximally 3)
- use `--next` (or `-n`) to sort jobs by their next execution time
- `--next=N` lists only *N* next jobs (e.g. `--next=3` prints maximally 3)
- use `-v` to display absolute times
- use `--timezone` (or `-tz`) to display times in specified timezone instead of one used by application
- e.g. `--tz=UTC`

### Worker command

Expand Down
4 changes: 2 additions & 2 deletions src/Command/ListCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ protected function configure(): void
{
/** @infection-ignore-all */
parent::configure();
$this->addOption('next', null, InputOption::VALUE_OPTIONAL, 'Sort jobs by their next execution time', false);
$this->addOption('timezone', null, InputOption::VALUE_REQUIRED, 'The timezone times should be displayed in');
$this->addOption('next', 'n', InputOption::VALUE_OPTIONAL, 'Sort jobs by their next execution time', false);
$this->addOption('timezone', 'tz', InputOption::VALUE_REQUIRED, 'The timezone times should be displayed in');
}

protected function execute(InputInterface $input, OutputInterface $output): int
Expand Down

0 comments on commit 9aea8e2

Please sign in to comment.