App-Midgen

 view release on metacpan or  search on metacpan

script/midgen  view on Meta::CPAN

#!perl

use 5.008001;
use strict;
use warnings FATAL => 'all';

our $VERSION = '0.34';

use English qw( -no_match_vars );
local $OUTPUT_AUTOFLUSH = 1;

use Data::Printer {caller_info => 1,};

# we are doing this so we can run from git during development
# perl ~/GitHub/App-Midgen/script/midgen
use FindBin qw($Bin);
use lib map {"$Bin/$_"} qw( lib ../lib );

use App::Midgen;
use Time::Stamp 'gmstamp';

#######
# get options from ~/.midgenrc
#######

# Encode and decode JSON
use JSON::Tiny;
my $json = JSON::Tiny->new;

use File::Spec;
use File::Slurp::Tiny qw(read_file write_file);

my $midgenrc = File::Spec->catfile($ENV{HOME}, '.midgenrc');

my $config;
if (-e $midgenrc) {
	$config = $json->decode(read_file($midgenrc));
}

#######
# Start of Menu
#######
use Getopt::Long;
Getopt::Long::Configure('bundling');
use Pod::Usage;
my $help         = 0;
my $core         = $config->{core} || 0;
my $dual_life    = $config->{dual_life} || 0;
my $verbose      = $config->{verbose} || 1;
my @format       = $config->{format} || 'dsl';
my $experimental = 0;
my $quiet        = $config->{quiet} || 0;
my $zero         = $config->{zero} || 0;
my $debug        = 0;
my $write        = 0;
GetOptions(
	'verbose|v+'     => \$verbose,
	'core|c!'        => \$core,
	'dual_life|l!'   => \$dual_life,
	'help|h|?'       => \$help,
	'experimental|x' => \$experimental,
	'format|f=s'     => \@format,
	'quiet|q'        => \$quiet,
	'zero|z!'        => \$zero,
	'debug|d'        => sub {
		$core    = 1;
		$verbose = 3;
		$debug   = 1;
	},
	'write|w' => \$write,



( run in 1.298 second using v1.01-cache-2.11-cpan-5837b0d9d2c )