X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=dev-gather.pl;h=f7116d900b97b04425d585d154116a84adec110d;hb=025e0d3f36c4b9bc3fc7db95d80625cfa61ee389;hp=0469777002de20228df29632d2d3c5616d416326;hpb=90d22dbea42652755cf9950e3fe4d7afa67174b5;p=scpubgit%2FSystem-Introspector.git diff --git a/dev-gather.pl b/dev-gather.pl index 0469777..f7116d9 100755 --- a/dev-gather.pl +++ b/dev-gather.pl @@ -3,8 +3,23 @@ use strictures 1; use lib qw( lib ); use Data::Dump qw( pp ); use Module::Runtime qw( use_module ); +use Getopt::Long; +use Data::YAML::Writer; + +GetOptions( + 'yaml' => \(my $opt_yaml), +); my $intro = shift(@ARGV) or die "Probe argument required\n"; -pp(use_module("System::Introspector::$intro")->new->gather); +my $data = use_module("System::Introspector::$intro")->new(@ARGV)->gather; +if ($opt_yaml) { + my $writer = Data::YAML::Writer->new; + my $output = ''; + $writer->write($data, \$output); + print $output; +} +else { + pp $data; +}