Analizo

 view release on metacpan or  search on metacpan

lib/Analizo.pm  view on Meta::CPAN

package Analizo;
use App::Cmd::Setup -app;
use strict;
use warnings;
use local::lib;

our $VERSION = '1.25.5';

=head1 NAME

analizo - multi-language source code analysis toolkit

=head1 USAGE

  analizo <tool> [tool-options] <toolargs> [<tool-args> ...]
  analizo <option>

=cut

sub global_opt_spec {
  return (
    [ 'help|h',    'displays the help (full manpage)' ],
    [ 'usage',     'displays the usage of the command' ],
    [ 'version|v', 'displays version information' ],
  );
}

sub config {
  my ($self) = @_;
  $self->{config} ||= (-e '.analizo'
    ? YAML::XS::LoadFile('.analizo')
    : {}
  );
}

sub load_command_options {
  my ($self, $command) = @_;
  if ($command && $self->config->{$command}) {
    split(/\s+/, $self->config->{$command});
  }
  else {
    ();
  }
}

sub prepare_args {
  my ($self) = @_;
  if (@ARGV) {
    my $command = shift @ARGV;
    my @options = $self->load_command_options($command);
    unshift @ARGV, $command, @options;
  }
  (@ARGV);
}

1;

=head1 DESCRIPTION

analizo is a suite of source code analysis tools, aimed at being
language-independent and extensible. The 'analizo' program is a wrapper for the
analizo tools, which do the real work, so most of the time you'll be using one
specific tool among the available ones. See TOOLS below for more information.

=head1 TOOLS

analizo has several individual tools that share a core infrastructure, but do
different analysis and produce different output. They are normally invoked like
this:

  analizo <tool> [tool-options] <tool-args> [<tool-args> ...]

Although you can invoke analizo tools against one or few files inside a project,
normally it only makes sense to run it against the entire source tree (e.g.
passing "." or "./src" as input directories).

The options and output are specific to each tool, so make sure to read the
corresponding manual for the tool(s) you want.

Run B<analizo> without any command line arguments to see the list of available



( run in 0.828 second using v1.01-cache-2.11-cpan-e1769b4cff6 )