package Getopt::Dakkar::Stash;
use Getopt::Dakkar::Style qw(class);
has options => ( is => 'ro' );
has arguments => ( is => 'ro' );
sub new_from_argpack($class,$argpack) {
return $class->new({
options => $argpack->options,
arguments => $argpack->arguments,
});
}
sub merge_with_argpack($self,$argpack) {
for my $f (qw(options arguments)) {
my $this = $self->$f;
my $that = $argpack->$f;
$this->{$_} = $that->{$_} for keys $that->%*;
}
return $self;
}