App-Changelord/lib/App/Changelord/Command/Schema.pm
2022-07-13 13:18:13 -04:00

30 lines
474 B
Perl

package App::Changelord::Command::Schema;
# SYNOPSIS: print out the changelog schema
use 5.36.0;
use Moo;
use CLI::Osprey;
use Path::Tiny;
use JSON;
use YAML;
option json => (
is => 'ro',
default => 0,
doc => 'output schema as json',
);
sub run($self) {
my $schema = path(__FILE__)->sibling('changelog-schema.yml')->slurp;
$schema = JSON->new->pretty->encode(YAML::Load($schema));
print $schema;
}
'end of App::Changelog::Command::Schema';