CLI-Driver

 view release on metacpan or  search on metacpan

lib/CLI/Driver/Action.pm  view on Meta::CPAN

package CLI::Driver::Action;

use Modern::Perl;
use Moose;
use namespace::autoclean;
use Kavorka '-all';
use Data::Printer alias => 'pdump';
use CLI::Driver::Deprecated;
use CLI::Driver::Class;
use CLI::Driver::Method;
use CLI::Driver::Help;
use Module::Load;
use File::Basename;
use YAML::Syck;

with 'CLI::Driver::CommonRole';

###############################
###### PUBLIC ATTRIBUTES ######
###############################

has href => (
    is       => 'rw',
    isa      => 'HashRef',
    required => 1
);

has name => ( is => 'rw', isa => 'Str' );
has desc => ( is => 'rw', isa => 'Str' );

has deprecated => (
    is      => 'rw',
    isa     => 'CLI::Driver::Deprecated',
    default => sub { CLI::Driver::Deprecated->new },
);

# DEPRECATED in favor of 'deprecated'
has is_deprecated => (
    is      => 'rw',
    isa     => 'Bool',
    default => 0,
);

has class          => ( is => 'rw', isa => 'CLI::Driver::Class' );
has 'method'       => ( is => 'rw', isa => 'CLI::Driver::Method' );
has 'help'         => ( is => 'rw', isa => 'CLI::Driver::Help' );
has 'use_argv_map' => ( is => 'rw', isa => 'Bool' );

##############################################################
# PUBLIC METHODS
##############################################################

method parse {
    
    $self->_handle_class  or return 0;
    $self->_handle_method or return 0;
    $self->_handle_deprecation;
    $self->_handle_desc;
    $self->_handle_help;

    return 1;
}

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

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