From 9aea8e25d25f1374878351629a8b63a0591529a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Barto=C5=A1?= Date: Tue, 19 Dec 2023 22:13:12 +0100 Subject: [PATCH] ListCommand: added shortcuts to options --- CHANGELOG.md | 3 ++- docs/README.md | 8 +++++--- src/Command/ListCommand.php | 4 ++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0dc85df..04fc758 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/docs/README.md b/docs/README.md index c019099..a56d826 100644 --- a/docs/README.md +++ b/docs/README.md @@ -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 diff --git a/src/Command/ListCommand.php b/src/Command/ListCommand.php index 7e87a8b..c4cf210 100644 --- a/src/Command/ListCommand.php +++ b/src/Command/ListCommand.php @@ -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