#!/usr/bin/env perl
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";

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;
}
