App-Sqitch

 view release on metacpan or  search on metacpan

lib/App/Sqitch/Command/tag.pm  view on Meta::CPAN

package App::Sqitch::Command::tag;

use 5.010;
use strict;
use warnings;
use utf8;
use Moo;
use App::Sqitch::X qw(hurl);
use Types::Standard qw(Str ArrayRef Maybe Bool);
use Locale::TextDomain qw(App-Sqitch);
use List::Util qw(first);
use namespace::autoclean;

extends 'App::Sqitch::Command';
with 'App::Sqitch::Role::ContextCommand';

our $VERSION = 'v1.6.1'; # VERSION

has tag_name => (
    is  => 'ro',
    isa => Maybe[Str],
);

has change_name => (
    is  => 'ro',
    isa => Maybe[Str],
);

has all => (
    is      => 'ro',
    isa     => Bool,
    default => 0
);

has note => (
    is       => 'ro',
    isa      => ArrayRef[Str],
    default  => sub { [] },
);

sub options {
    return qw(
        tag-name|tag|t=s
        change-name|change|c=s
        all|a!
        note|n|m=s@
    );
}

sub configure {
    my ( $class, $config, $opt ) = @_;
    # Just keep options.
    return $opt;
}

sub execute {
    my $self   = shift;
    my ($name, $change, $targets) = $self->parse_args(
        names      => [$self->tag_name, $self->change_name],
        all        => $self->all,
        args       => \@_,
        no_changes => 1,
    );

    if (defined $name) {
        my $note = join "\n\n" => @{ $self->note };
        my (%seen, @plans, @tags);
        for my $target (@{ $targets }) {
            next if $seen{$target->plan_file}++;
            my $plan = $target->plan;
            push @tags => $plan->tag(
                name   => $name,



( run in 0.963 second using v1.01-cache-2.11-cpan-5a3173703d6 )