diff options
Diffstat (limited to 'lib/App/Beam/Backup.pm')
-rw-r--r-- | lib/App/Beam/Backup.pm | 44 |
1 files changed, 41 insertions, 3 deletions
diff --git a/lib/App/Beam/Backup.pm b/lib/App/Beam/Backup.pm index 78e62f4..ed8953b 100644 --- a/lib/App/Beam/Backup.pm +++ b/lib/App/Beam/Backup.pm @@ -8,14 +8,52 @@ our @ISA = qw(App::Beam); use Unix::Sysexits; +=head1 NAME + +beam backup - create new backup + +=head1 SYNOPSIS + +B<beam> [I<OPTIONS>] B<backup> + +=head1 DESCRIPTION + +=head1 OPTIONS + +=over 4 + +=item B<-h> + +Print a short help summary. + +=item B<--help> + +Display manpage. + +=item B<--usage> + +Print a short command line usage reminder. + +=back + +=cut + sub run { my $self = shift; - shift; # Skip subcommand name - $self->abend(EX_USAGE, "bad number of arguments") if @_; + #GetOptionsFromArray(\@_, ...); + my @items = split /\s+/, $self->get('core.items'); + if (@_) { + push @items, $self->names_of('item'); + foreach my $item (@_) { + $self->abend(EX_USAGE, "$item: no such item defined") + unless grep { $item eq $_ } @items; + } + @items = @_; + } $self->lock(); - foreach my $item (split /\s+/, $self->get('core.items')) { + foreach my $item (@items) { my $backend = $self->{backend}{$self->get("item.$item.backend")}; $backend->backup($item); } |