csniff - Command line interface to Class::Sniff graphs.
Class::Sniff
csniff [options] dir(s)
Boolean options:
-v, --verbose Print what classes are being loaded -p, --png Output as png (requires 'dot' executable) -g, --gif Output as gif (requires 'dot' executable) -t, --text Output as text (large graphs may not render well)
Options that take arguments:
-n, --namespace Perl regex to match desired namespaces -i, --ignore Perl regex to exclude namespaces -I, Use this path with "use lib". Can be set multiple times for more than one path. -o --output Graph format as understood by 'dot' (eg. svg, dia)
Given one or more directories, attempts to render a Class::Sniff graph for all modules found in them. This may be very slow. Be patient. Output is sent to STDOUT, so redirect it where you will.
If no namespace argument is passed, it will attempt to graph every namespace. Because some of the modules Class::Sniff must load are fairly heavyweight, you will get plenty of modules showing up in the graph which you didn't expect. And it will be slow. Did I mention that already?
namespace
DBIx::Class
You have a bunch of DBIx::Class resultset objects, but you don't want to see the DBIx::Class hierarchy.
As text graph:
csniff --namespace '^My::ResultSet' --ignore '^DBIx' \ lib/My/ResultSet > rs.txt
As text graph with short options:
csniff -n '^My::Resultset' -i '^DBIx' lib/My/ResultSet > rx.txt
As PNG:
csniff -n '^My::Resultset' -i '^DBIx' --png lib/My/ResultSet > rx.png
As Gif:
csniff -n '^My::Resultset' -i '^DBIx' --gif lib/My/ResultSet > rx.gif
Note that the --gif and --png options require that you have the dot executable installed and in your PATH. dot is part of the GraphViz package (http://www.graphviz.org/).
--gif
--png
dot
PATH
Curtis "Ovid" Poe, <ovid at cpan.org>
<ovid at cpan.org>
Please report any bugs or feature requests to bug-class-sniff at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Class-Sniff. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-class-sniff at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc Class::Sniff
You can also look for information at:
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Class-Sniff
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Class-Sniff
CPAN Ratings
http://cpanratings.perl.org/d/Class-Sniff
Search CPAN
http://search.cpan.org/dist/Class-Sniff/
Copyright 2009 Curtis "Ovid" Poe, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Class::Sniff, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Class::Sniff
CPAN shell
perl -MCPAN -e shell install Class::Sniff
For more information on module installation, please visit the detailed CPAN module installation guide.