ADD: allow commandline argument for issue description
This commit is contained in:
parent
61d2e879e9
commit
4e9c713f19
@ -52,7 +52,14 @@ option 'type' => (
|
||||
default => "bug"
|
||||
);
|
||||
|
||||
|
||||
option 'description' => (
|
||||
is => 'ro',
|
||||
isa => 'Str',
|
||||
required => 0,
|
||||
documentation => q[the description of the issue, only plain text or markdown. If not given an editor is started.],
|
||||
cmd_aliases => [qw(d)],
|
||||
default => ""
|
||||
);
|
||||
|
||||
|
||||
sub run
|
||||
@ -64,15 +71,24 @@ sub run
|
||||
print("IssueManager not initialized yet. Please call \"init\" command to do so.");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
|
||||
my ($fh, $filename) = tempfile();
|
||||
close($fh);
|
||||
|
||||
my $config=App::Git::IssueManager::Config->new(confname => 'config');
|
||||
my $editor = $config->get(key=>"core.editor") || ENV{'EDITOR'} || "vim";
|
||||
|
||||
my $text;
|
||||
if ($self->description eq "")
|
||||
{
|
||||
system($editor . " " .$filename);
|
||||
|
||||
my $text = read_file($filename);
|
||||
$text = read_file($filename);
|
||||
}
|
||||
else
|
||||
{
|
||||
$text = $self->description;
|
||||
}
|
||||
|
||||
my $issue = Git::IssueManager::Issue->new(subject => $self->subject);
|
||||
$issue->description($text);
|
||||
|
Loading…
Reference in New Issue
Block a user