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 0.10
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;
No documentation here yet, uses Nour::Config.
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).
No documentation here yet, uses Nour::Database.
No documentation here yet, uses Nour::Logger.
Nour::Script
Nour Sharabash <amirite@cpan.org>
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.
To install Nour, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Nour
CPAN shell
perl -MCPAN -e shell install Nour
For more information on module installation, please visit the detailed CPAN module installation guide.