App-Changelord/lib/App/Changelord/Command/Print.pm

40 lines
859 B
Perl
Raw Normal View History

2022-07-25 15:21:03 +00:00
package App::Changelord::Command::Print;
use 5.36.0;
use Moo;
use CLI::Osprey
desc => 'print the changelog',
description_pod => <<'END';
Render the full changelog. The default is to render the changelog
in markdow, but the option C<--json> can be used to have a JSON
version instead.
2022-07-25 15:32:27 +00:00
To generate the changelog without the NEXT release, uses the
C<--no-next> option.
2022-07-25 15:21:03 +00:00
END
with 'App::Changelord::Role::Changelog';
with 'App::Changelord::Role::ChangeTypes';
with 'App::Changelord::Role::Render';
option json => (
is => 'ro',
default => 0,
doc => 'output schema as json',
);
2022-07-25 15:32:27 +00:00
option next => (
is => 'ro',
default => 1,
negatable => 1,
doc => 'include the NEXT release. Defaults to true.',
);
2022-07-25 15:21:03 +00:00
sub run($self) {
no warnings 'utf8';
2022-07-25 15:32:27 +00:00
print $self->as_markdown( $self->next );
2022-07-25 15:21:03 +00:00
}
'end of App::Changelog::Command::Print';