mediawiki merging, row identification, tests
[scpubgit/System-Introspector-Report.git] / bin / system-introspector-report
CommitLineData
499ebcdd 1#!/usr/bin/env perl
2use strictures;
3use Getopt::Long;
4use Pod::Usage;
5use System::Introspector::Report::Source;
6use System::Introspector::Report::Config;
7
8GetOptions(
9 's|storage=s' => \my $storage_dir,
10 'c|config=s' => \my $config_file,
11 'r|report=s' => \my @report_types,
12 'p|publish=s' => \my @publish_types,
13 'a|all' => \my $all_reports,
14 'h|help' => sub { pod2usage(0) },
15) or pod2usage(2);
16
17die "$0 requires --storage (-s) to be specified\n"
18 unless defined $storage_dir;
19
20die "$0 requires --config (-c) to be specified\n"
21 unless defined $storage_dir;
22
23my $config = System::Introspector::Report::Config
24 ->new(config_file => $config_file);
25
26my $source = System::Introspector::Report::Source
27 ->new_from_root($storage_dir);
28
29my @types = $all_reports
30 ? $config->report_types
31 : map [$_, {}], @report_types;
32my @reports = $source->generate(@types);
33
34for my $publisher ($config->publishers(@publish_types)) {
35 $publisher->publish(\@reports);
36}
37
38__END__
39
40=head1 NAME
41
42system-introspector-report - Generate System::Introspector reports
43
44=cut