X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=dev-gather.pl;h=f7116d900b97b04425d585d154116a84adec110d;hb=025e0d3f36c4b9bc3fc7db95d80625cfa61ee389;hp=3c9657de593113b920d1e6905d2c616a8fbfedad;hpb=72d4f529736d58e90eae0f5987295cd0187ea27e;p=scpubgit%2FSystem-Introspector.git diff --git a/dev-gather.pl b/dev-gather.pl index 3c9657d..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(@ARGV)->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; +}