#!/usr/bin/perl -w
use strict;
use lib './lib';
use base 'LEOCHARRE::CLI';
use LEOCHARRE::PMSubs 'subs_defined';
our $VERSION = sprintf "%d.%02d", q$Revision: 1.1 $ =~ /(\d+)/g;

my $o = gopts('p');
$o->{p} ||=0;

my $files = argv_aspaths() or warn('missing argument list') and exit;


for (@$files){
   showone($_);
}

exit;


sub showone {
   my $abs = shift;
   
   if (scalar @$files > 1){
      print "[$abs]\n";
   }

   my $subs = subs_defined($abs,$o->{p});
      
   map { print "$_\n" } @$subs;

   print "\n";
}




=pod

=head1 NAME

pmsubs

=head1 DESCRIPTION

prints to screen all subs defined in a perl code file

=head1 OPTION FLAGS

   -p show only public methods/subs, dont show subs starting with an underscore.
   -d debug on
   -v print version and exit
   -h help
   
=head1 EXAMPLE USAGE

   pmsubs ./script.pl
   pmsubs ./lib/Module.pm
   pmsubs -p ./lib/Module.pm
   pmsubs -p ./lib/*pm
   

=head1 AUTHOR

Leo Charre leocharre at cpan dot org

=head1 SEE ALSO

Part of package L<LEOCHARRE::Dev>.

=cut
