ADD: command to reopen an issue
This commit is contained in:
parent
59433c506b
commit
595614e8a0
38
lib/App/Git/IssueManager/Open.pm
Normal file
38
lib/App/Git/IssueManager/Open.pm
Normal file
@ -0,0 +1,38 @@
|
||||
package App::Git::IssueManager::Open;
|
||||
#ABSTRACT: class implementing the open issue command of the GIT IssueManager
|
||||
use strict;
|
||||
use warnings;
|
||||
use MooseX::App::Command;
|
||||
extends qw(App::Git::IssueManager);
|
||||
use Git::LowLevel;
|
||||
use Git::IssueManager;
|
||||
use Git::IssueManager::Issue;
|
||||
|
||||
use Term::ANSIColor;
|
||||
use Try::Tiny;
|
||||
|
||||
|
||||
command_short_description 'reopen an issue from a repository identified by the given id';
|
||||
command_usage 'git issue open -i TST-a34df432';
|
||||
|
||||
option 'id' => (
|
||||
is => 'ro',
|
||||
isa => 'Str',
|
||||
required => 1,
|
||||
documentation => q[the id of the issue],
|
||||
cmd_aliases => [qw(i)]
|
||||
);
|
||||
|
||||
sub run
|
||||
{
|
||||
my $self = shift;
|
||||
my $manager = Git::IssueManager->new(repository=>Git::LowLevel->new(git_dir=> "."));
|
||||
if (!$manager->ready)
|
||||
{
|
||||
print("IssueManager not initialized yet. Please call \"init\" command to do so.");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
my $issue=$manager->open($self->id);
|
||||
}
|
||||
1;
|
Loading…
Reference in New Issue
Block a user