Lines Matching +full:- +full:- +full:stderr
10 * @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html
18 $options->setHelp('Collect statistics about the cache directory.');
20 $options->registerOption('noprogress', 'Don\'t show progress dots');
21 … $options->registerOption('format', 'Output format. Defaults to table.', 'f', 'table|json|csv');
22 …$options->registerOption('sort', 'Sort by this criteria. Defaults to size.', 's', 'count|size|dups…
30 $sort = $options->getOpt('sort', 'size');
32 $this->error("Invalid sort option '$sort'. Allowed are: count, size, dups.");
36 $format = $options->getOpt('format', 'table');
38 $this->error("Invalid format option '$format'. Allowed are: table, json, csv.");
42 // progress report - collecting stats can take a while
43 fprintf(STDERR, 'Collecting cache statistics from ' . $conf['cachedir'] . "…\n");
44 if(!$options->getOpt('noprogress')) {
47 fprintf(STDERR, "%s files processed\n", number_format($count));
49 fprintf(STDERR, ".");
56 $result = (new FileStatistics($conf['cachedir']))->collect($cb);
57 if($cb) fprintf(STDERR, "\n");
65 'json' => $this->print_json($result),
66 'csv' => $this->print_csv($result),
67 default => $this->print_table($result),
87 $this->error('Could not open output for CSV.');
107 $widths = array_merge(['*'], array_fill(0, count($headers) -1, $colWidth));
111 $tr = new TableFormatter($this->colors);
112 if($tr->getMaxWidth() < $colWidth * count($headers)){;
113 $tr->setMaxWidth($colWidth * count($headers) + 10);
116 echo $tr->format($widths, $headers, $colors);
127 echo $tr->format(