CLI-Driver

 view release on metacpan or  search on metacpan

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

package CLI::Driver;

=head1 NAME

CLI::Driver - Drive your cli tool with YAML

=cut

use Modern::Perl;
use Moose;
use namespace::autoclean;
use Kavorka 'method';
use Data::Printer alias => 'pdump';
use CLI::Driver::Action;
use Module::Load;

use Getopt::Long;
Getopt::Long::Configure('no_ignore_case');
Getopt::Long::Configure('pass_through');
Getopt::Long::Configure('no_auto_abbrev');

use YAML::Syck;

with 'CLI::Driver::CommonRole';

our $VERSION = 0.77;

=head1 SYNOPSIS

  use CLI::Driver;
   
  my $cli = CLI::Driver->new;
  $cli->run;

  - or - 
   
  my $cli = CLI::Driver->new(
      path => './etc:/etc',
      file => 'myconfig.yml'
  );
  $cli->run;
    
  - or - 

  my $cli = CLI::Driver->new(
      use_file_sharedir => 1,
      file_sharedir_dist_name => 'CLI-Driver',
  );
  $cli->run;
                       
  #################################
  # cli-driver.yml example
  ################################# 
  do-something:
    desc: "Action description"
    deprecated:
      status: false
      replaced-by: na
    class:
      name: My::App
      attr:
        required:
          hard:
            f: foo
          soft:
            h: home
            a: '@array_arg'
        optional:
        flags:
          dry-run: dry_run_flag
    method:



( run in 0.595 second using v1.01-cache-2.11-cpan-39bf76dae61 )