Greetings,

I'm writing a command line util in my mojo project. I'm trying to make
the command module print out pod.

package DeltaR::Command::query;
use Mojo::Base 'Mojolicious::Command';
use Pod::Usage 'pod2usage';

sub run
{
my ( $self, @args ) = @_; my %query_params;

# snip

  usage() if ( $query_params{'help'} );
}

sub usage
{
  my $msg = shift;
  say "Running usage in file $0";
  pod2usage(-verbose=>99,
     -sections=>"SYNOPSIS",
     -msg => $msg
); }

1;

=pod

=head1 SYNOPSIS
Yada, yada

The sub usage runs but does not print the synopsis. It seems to be
looking in the mother file, DeltaR.pl. How can it make it look in the
module file where usage exists?

# script/query -h
[Fri May 16 12:55:59 2014] [debug] Reading configuration file 
"/opt/delta_reporting/app/DeltaR.conf".
Running usage in file DeltaR.pl
DeltaR::Command::query=HASH(0x1d09e48)

--
Neil Watson
Linux/UNIX Consultant
http://watson-wilson.ca

--
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To post to this group, send email to mojolicious@googlegroups.com.
Visit this group at http://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.

Reply via email to