NAME

Nour::Script - script bootstrap: let's you stop wasting time rewriting the same code for every script and start mashing code for the core process at hand.

VERSION

version 0.10

SYNOPSIS

Here's the quickest example:

#!/usr/bin/env perl

{
    package Script::Generate;
    use Moose; with 'Nour::Script';

    sub run {
        my ( $self ) = @_;
        $self->debug( 'testing' );
    }

    1;
}

Script::Generate->new->run;

USAGE

Configuration setup

No documentation here yet, uses Nour::Config.

Command-line options

In your script configuration, include an 'option' hash with two properties: - getopts: an array of defined options (using Getopt::Long syntax) - default: a hash of default values for the defined options

here's an example:

---
other: configuration
stuff: bananas
option:
    getopts:
        - source=s
        - target:s
        - width:i
        - bigger+
        - crop
        - force!
    default:
        force: 1

Configuration goes in either ./config/your/package/name/ or ./config/your/package/name.yml (scripts have to be defined as packages for this extension because it's written as a Moose::Role mix-in). See "Configuration setup" in Nour::Script for details.

By default, these options are configured: - verbose+ - silent - help|? - mode=s

The mode option is used in conjunction with database configuration (if you set that up).

Database utility

No documentation here yet, uses Nour::Database.

Using the logger

No documentation here yet, uses Nour::Logger.

NAME

Nour::Script

AUTHOR

Nour Sharabash <amirite@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2014 by Nour Sharabash.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.