App-PrereqGrapher

 view release on metacpan or  search on metacpan

bin/prereq-grapher  view on Meta::CPAN

#!/usr/bin/env perl
use strict;
use warnings;
use App::PrereqGrapher;

my $app = App::PrereqGrapher->new_with_options;

$app->generate_graph(@ARGV);

exit 0;

=head1 NAME

prereq-grapher - generate dependency graph for perl module or source

=head1 SYNOPSIS

 prereq-grapher [options] Foo::Bar .. Foo::Baz

 Options:
   -o <file>    The file to write the graph into
   -d <int>     Stop recursing at the specified depth
   -t <seconds> Timeout for when generating SVG or HTML output
   -nc          Don't include core modules in dependency graph
   -nrc         Show core modules, but not their dependencies
   -dot         Generate graph in dot format (used by GraphViz)
   -svg         Generate graph as Scalable Vector Graphics
   -html        Generate graph as HTML
   -gml         Generate graph as GraphML
   -vcg         Generate graph in VCG format
   -verbose     Display verbose messages as we run
   -h --help    This help

=head1 DESCRIPTION

B<prereq-grapher> parses perl source and looks for prerequisites,
such as modules that are C<use>'d or C<require>'d.
All of those modules are then parsed in turn,
looking for I<their> dependencies.

Once all files have been parsed, B<prereq-grapher> will write out
the dependency graph in one of the five formats supported.

The simplest way to run B<prereq-grapher> is just giving a module name:

  % prereq-grapher Module::Path
  6 modules processed. Graph written to dependencies.dot

By default B<prereq-grapher> generates the dependency graph in C<dot> format,
and writes it to a file called C<dependencies.dot>.
You can explicitly specify the output format and filename:

  % prereq-grapher -svg -o class-inspector-path.svg Class::Inspector
  9 modules processed. Graph written to class-inspector.svg

If the complete dependency graph is very large,
it can be hard to get your head around it.
In this case you could start off generating the first few levels of dependencies,
using the B<-depth> (or B<-d>) option:

  % prereq-grapher App::PrereqGrapher
  305 modules processed. Graph written to dependencies.dot

  % prereq-grapher -depth 2 App::PrereqGrapher
  10 modules processed. Graph written to dependencies.dot

=head1 OPTIONS

=over 4

=item B<-o> E<lt>fileE<gt> | B<-output-file> E<lt>fileE<gt>

The name of the file that the dependency graph should be written to.
If not specified, B<prereq-grapher> will write the graph in a file
called C<dependencies>, and the extension will indicate the format
(dot, svg, html, gml, or vcg).

=item B<-d N> | B<-depth N>

Generate the dependency graph to a depth of no more than N links.

=item B<-r T> | B<-timeout T>

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 0.471 second using v1.00-cache-2.02-grep-82fe00e-cpan-2c419f77a38b )