#!/usr/bin/env perl
use strict;
use warnings;
use FindBin;
use lib "$FindBin::Bin/../lib";
use lib "$FindBin::Bin/lib";
use Data::Dumper;
use OptArgs2;

$Data::Dumper::Indent   = 1;
$Data::Dumper::Sortkeys = 1;

arg aaa => (
    isa      => 'Str',
    required => 1,
    comment  => 'some kind of arg',
);

arg bbb => (
    isa          => 'Str',
    comment      => 'other some kind of arg',
    default      => 'meh',
    show_default => 1,
);

opt help => (
    isa     => 'Flag',
    comment => 'print help message and exit',
    alias   => 'h',
    ishelp  => 1,
);

opt quiet => (
    isa     => 'Flag',
    comment => 'work quietly',
    alias   => 'q',
);

my $opts = eval { optargs };
my $err = $@;
print $INC{'OptArgs2.pm'}, "\n";
print $err ? '(' . ( ref $err ) . ")\n$err" : Dumper($opts) =~ s/VAR1/opts/r;
