40 lines
693 B
Perl
40 lines
693 B
Perl
package App::Changelord;
|
|
|
|
# version next latest
|
|
|
|
use 5.36.0;
|
|
|
|
use Moo;
|
|
use CLI::Osprey;
|
|
use YAML;
|
|
|
|
use List::AllUtils qw/ pairmap partition_by /;
|
|
|
|
use App::Changelord::Role::ChangeTypes;
|
|
|
|
option source => (
|
|
is => 'ro',
|
|
format => 's',
|
|
doc => 'changelog yaml file',
|
|
default => 'CHANGELOG.yml',
|
|
);
|
|
|
|
has changelog => ( is => 'lazy' );
|
|
|
|
sub _build_changelog($self) {
|
|
return YAML::LoadFile($self->source)
|
|
}
|
|
|
|
with 'App::Changelord::Role::ChangeTypes';
|
|
with 'App::Changelord::Role::Render';
|
|
|
|
sub run($self) {
|
|
no warnings 'utf8';
|
|
print $self->as_markdown;
|
|
}
|
|
|
|
subcommand $_ => 'App::Changelord::Command::' . ucfirst $_
|
|
for qw/ schema validate version bump init add/;
|
|
|
|
1;
|