6 use System::Introspector::Report::Source;
7 use System::Introspector::Report::Config;
10 's|storage=s' => \my $storage_dir,
11 'c|config=s' => \my $config_file,
12 'r|report=s' => \my @report_types,
13 'p|publish=s' => \my @publish_types,
14 'a|all' => \my $all_reports,
15 'h|help' => sub { pod2usage(0) },
18 die "$0 requires --storage (-s) to be specified\n"
19 unless defined $storage_dir;
21 die "$0 requires --config (-c) to be specified\n"
22 unless defined $storage_dir;
24 my $config = System::Introspector::Report::Config
25 ->new(config_file => $config_file);
27 my $source = System::Introspector::Report::Source
28 ->new_from_root($storage_dir);
30 my @types = $all_reports
31 ? $config->report_types
32 : map [$_, {}], @report_types;
33 my @reports = $source->generate(@types);
35 for my $publisher ($config->publishers(@publish_types)) {
37 $publisher->publish(\@reports);
40 print "Error during publish: $_\n";
48 system-introspector-report - Generate System::Introspector reports