From d9c83634070bf9f5f71d780c1c6d47faa07421b5 Mon Sep 17 00:00:00 2001 From: Lars Vierbergen Date: Wed, 8 Nov 2017 07:42:08 +0100 Subject: [PATCH] Add option to dump raw statistic values --- Command/DumpStatsCommand.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Command/DumpStatsCommand.php b/Command/DumpStatsCommand.php index 72f4401..79d50ae 100644 --- a/Command/DumpStatsCommand.php +++ b/Command/DumpStatsCommand.php @@ -31,7 +31,9 @@ class DumpStatsCommand extends Command protected function configure() { - $this->setName('stats:dump')->addOption('module', 'm', InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'Modules to fetch statistics for'); + $this->setName('stats:dump') + ->addOption('module', 'm', InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'Modules to fetch statistics for') + ->addOption('raw', null, InputOption::VALUE_NONE, 'Output raw statistics list'); } protected function execute(InputInterface $input, OutputInterface $output) @@ -52,11 +54,16 @@ class DumpStatsCommand extends Command 'Value' ]); foreach ($event->getStatistics() as $name => $value) { + if ($input->getOption('raw')) { + $output->writeln($name . "\t" . $value, OutputInterface::OUTPUT_RAW); + } $table->addRow([ $name, $value ]); } - $table->render(); + if (!$input->getOption('raw')) { + $table->render(); + } } } \ No newline at end of file