From 1308fcacd183f8aabe4adad2c06ecefe26900388 Mon Sep 17 00:00:00 2001 From: Nyholm Date: Fri, 23 Apr 2021 17:40:01 +0200 Subject: [PATCH 1/4] Dont print errors by default --- src/Command/BuildDocsCommand.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Command/BuildDocsCommand.php b/src/Command/BuildDocsCommand.php index 8b7b7a6..9c313f4 100644 --- a/src/Command/BuildDocsCommand.php +++ b/src/Command/BuildDocsCommand.php @@ -91,6 +91,12 @@ protected function configure() InputOption::VALUE_NONE, 'Return a non-zero code if there are errors/warnings' ) + ->addOption( + 'print-errors', + null, + InputOption::VALUE_NONE, + 'Print errors when to standard output' + ) ; } @@ -137,7 +143,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int KernelFactory::createKernel($this->buildConfig, $this->urlChecker ?? null) ); - $this->addProgressListener($builder->getConfiguration()->getEventManager()); + $configuration = $builder->getConfiguration(); + $configuration->silentOnError(!$input->getOption('print-errors')); + $this->addProgressListener($configuration->getEventManager()); $builder->build( $this->buildConfig->getContentDir(), From de82f2914a2b3bab18ec303ac71462b475d8c42f Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Sat, 24 Apr 2021 20:03:48 +0200 Subject: [PATCH 2/4] Update src/Command/BuildDocsCommand.php Co-authored-by: Ryan Weaver --- src/Command/BuildDocsCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Command/BuildDocsCommand.php b/src/Command/BuildDocsCommand.php index 9c313f4..c8b9689 100644 --- a/src/Command/BuildDocsCommand.php +++ b/src/Command/BuildDocsCommand.php @@ -95,7 +95,7 @@ protected function configure() 'print-errors', null, InputOption::VALUE_NONE, - 'Print errors when to standard output' + 'Print errors to standard output' ) ; } From 95a358bdfc69aed4f4f9c1f6c9e947d0f56c50fd Mon Sep 17 00:00:00 2001 From: Nyholm Date: Sat, 24 Apr 2021 20:06:43 +0200 Subject: [PATCH 3/4] Move around the options --- src/Command/BuildDocsCommand.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Command/BuildDocsCommand.php b/src/Command/BuildDocsCommand.php index c8b9689..883b36b 100644 --- a/src/Command/BuildDocsCommand.php +++ b/src/Command/BuildDocsCommand.php @@ -80,22 +80,22 @@ protected function configure() 'Path where any errors should be saved' ) ->addOption( - 'no-theme', + 'print-errors', null, InputOption::VALUE_NONE, - 'Use the default theme instead of the styled one' + 'Print errors to standard output' ) ->addOption( - 'fail-on-errors', + 'no-theme', null, InputOption::VALUE_NONE, - 'Return a non-zero code if there are errors/warnings' + 'Use the default theme instead of the styled one' ) ->addOption( - 'print-errors', + 'fail-on-errors', null, InputOption::VALUE_NONE, - 'Print errors to standard output' + 'Return a non-zero code if there are errors/warnings' ) ; } From 3bc92ae4fd72d2c848a6ad1d9a30e0952803673a Mon Sep 17 00:00:00 2001 From: Nyholm Date: Sun, 25 Apr 2021 13:33:59 +0200 Subject: [PATCH 4/4] Rename to disable-parse-errors-on-stdout --- src/Command/BuildDocsCommand.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Command/BuildDocsCommand.php b/src/Command/BuildDocsCommand.php index 883b36b..75e5fe0 100644 --- a/src/Command/BuildDocsCommand.php +++ b/src/Command/BuildDocsCommand.php @@ -80,10 +80,10 @@ protected function configure() 'Path where any errors should be saved' ) ->addOption( - 'print-errors', + 'disable-parse-errors-on-stdout', null, InputOption::VALUE_NONE, - 'Print errors to standard output' + 'Don\'t print errors to standard output' ) ->addOption( 'no-theme', @@ -144,7 +144,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int ); $configuration = $builder->getConfiguration(); - $configuration->silentOnError(!$input->getOption('print-errors')); + $configuration->silentOnError($input->getOption('disable-parse-errors-on-stdout')); $this->addProgressListener($configuration->getEventManager()); $builder->build(