I::Simple->new(
option_specs => [ qw( help format=s ) ],
default_options => { format => 'json' }, # set some defaults
extra_options => [ qw( content ) ], # non-option, setter/getter
c
I::Simple->new(
option_specs => [qw( help format=s )],
default_options => { format => 'json' }, # set some defaults
extra_options => [qw( content )], # non-option, setter/gette
ith a clear error.
=back
=head2 Usage examples
# Using an option alias
script.pl --cfg app.json execute
# Using a command alias
script.pl ls
After parsing, both C<get_config()> and C<get_
er;
use English qw(-no_match_vars);
use JSON qw(decode_json);
use List::Util qw(none);
use parent qw(Exporter);
our @EXPORT_OK = qw( slurp slurp_json dump_json normalize_options dmp);
our $VERSION
p_json {
########################################################################
my ($file) = @_;
my $json = eval { return decode_json( slurp($file) ) };
croak "ERROR: could not decode JSON s
tring:\n$EVAL_ERROR\n"
if !$json || $EVAL_ERROR;
return $json;
}
########################################################################
sub slurp {
##########################################