Skip to content

Conversation

@odolbeau
Copy link
Member

Fix #111

)
->addArgument('configuration', InputArgument::OPTIONAL, 'The configuration to use', 'default')
->addOption('cache', null, InputOption::VALUE_NONE, 'Clear the cache if the translations have changed')
->addOption('cache', null, InputOption::VALUE_NONE, '[DEPRECATED] Cache is now automatically cleared when translations have changed.')
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WDYT about this?

if ($input->getOption('cache')) {
$message = 'The --cache option is deprecated as it\'s now the default behaviour of this command.';

$io->error($message);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it relevant to display an error or is the trigger_error call enough?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question, especially as it's on CLI.

Maybe use note? To be sure return code isn't affected?

https://symfony.com/doc/current/console/style.html#admonition-methods

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The return code is never affected by what you display in the CLI. :)
With a note:
image
Wit a caution:
image
With an error:
image

My question was: should we display something in the cli regarding the deprecated option or is the trigger_error call enough?
I used a note as suggested cause it's less "violent" than a caution or an error but we still have the information directly in the cli which is relevant IMO.

@odolbeau odolbeau force-pushed the improve-download-command branch from da2c93a to 46e2754 Compare December 26, 2019 17:24
if ($input->getOption('cache')) {
$message = 'The --cache option is deprecated as it\'s now the default behaviour of this command.';

$io->error($message);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question, especially as it's on CLI.

Maybe use note? To be sure return code isn't affected?

https://symfony.com/doc/current/console/style.html#admonition-methods

@odolbeau odolbeau force-pushed the improve-download-command branch from 46e2754 to eaf8af4 Compare December 29, 2019 10:07
@odolbeau odolbeau merged commit 0b808fc into php-translation:master Dec 29, 2019
@odolbeau odolbeau deleted the improve-download-command branch December 29, 2019 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Command "translation:download" should be more verbose

3 participants