|
#!/usr/bin/perl
use 5.008005;
BEGIN {
$VERSION = '0.06' ;
}
my $PERL = undef ;
my $PHASE = undef ;
my $VERBOSE = 0;
my $RANKDIR = 0;
my $REVERSE = 0;
Getopt::Long::GetOptions(
'perl=s' => \ $PERL ,
'phase=s' => \ $PHASE ,
'verbose' => \ $VERBOSE ,
'rankdir' => \ $RANKDIR ,
'reverse' => \ $REVERSE ,
) or die "Failed to parse options" ;
my $name = shift @ARGV ;
unless ( $name ) {
print "Did not provide a distribution name\n" ;
exit (0);
}
CPANDB-> import ( {
show_progress => $VERBOSE ,
} );
my $dist = CPANDB->distribution( $name );
my $file = $name ;
if ( $PHASE ) {
$file .= '-' . $PHASE ;
}
if ( $PERL ) {
$file .= '-' . $PERL ;
}
my $method = $REVERSE
? 'dependants_graphviz'
: 'dependency_graphviz' ;
$dist -> $method (
perl => $PERL ,
phase => $PHASE ,
rankdir => $RANKDIR ,
)->as_svg( "$file.svg" );
|