NAME

CLI::Driver

SYNOPSIS

This is a module to drive your cli tool from a yaml config file.

use CLI::Driver;

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

my $action = $cli->get_action( name => $ActionFromArgv );
if ($action) {
    $action->do;
}
else {
    $Driver->fatal("failed to find action in config file");
}

### cli-driver.yml example

do-something:
  desc: "Action description"
  class:
    name: My::App
    attr:
      required:
        hard:
          f: foo
        soft:
          h: home
          a: '@array_arg'
      optional:
      flags:
        dry-run: dry_run_flag
  method:
    name: my_method
    args:
      required: 
        hard: 
        soft:
      optional:
      flags:
  help:
    args:
      f: "Additional help info for argument 'f'"
    examples:
      - "-f foo -a val1 -a val2 --dry-run"