| 1 | package App::Sandy::Command::Quality::Remove; | ||
| 2 | # ABSTRACT: quality subcommand class. Remove a quality profile from database. | ||
| 3 | |||
| 4 | 1 | ▶ | use App::Sandy::Base 'class'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | extends 'App::Sandy::Command::Quality'; | ||
| 7 | |||
| 8 | our $VERSION = '0.25'; # VERSION | ||
| 9 | |||
| 10 | override 'opt_spec' => sub { | ||
| 11 | super, | ||
| 12 | 'verbose|v' | ||
| 13 | }; | ||
| 14 | |||
| 15 | sub validate_args { | ||
| 16 | my ($self, $args) = @_; | ||
| 17 | my $quality_profile = shift @$args; | ||
| 18 | |||
| 19 | if (not defined $quality_profile) { | ||
| 20 | die "Missing quality-profile\n"; | ||
| 21 | } | ||
| 22 | |||
| 23 | die "Too many arguments: '@$args'\n" if @$args; | ||
| 24 | } | ||
| 25 | |||
| 26 | sub execute { | ||
| 27 | my ($self, $opts, $args) = @_; | ||
| 28 | my $quality_profile = shift @$args; | ||
| 29 | |||
| 30 | $LOG_VERBOSE = exists $opts->{verbose} ? $opts->{verbose} : 0; | ||
| 31 | |||
| 32 | log_msg ":: Attempting to remove '$quality_profile' ..."; | ||
| 33 | $self->deletedb($quality_profile); | ||
| 34 | log_msg ":: Done!"; | ||
| 35 | } | ||
| 36 | |||
| 37 | __END__ | ||