| 1 | package App::SD::CLI::Command::Attachment::Create; | ||
| 2 | use Any::Moose; | ||
| 3 | extends 'Prophet::CLI::Command::Create'; | ||
| 4 | with 'App::SD::CLI::Model::Attachment'; | ||
| 5 | with 'App::SD::CLI::Command'; | ||
| 6 | |||
| 7 | sub run { | ||
| 8 | my $self = shift; | ||
| 9 | |||
| 10 | $self->print_usage if $self->has_arg('h'); | ||
| 11 | |||
| 12 | my $content = $self->get_content(type => 'attachment'); | ||
| 13 | |||
| 14 | die "Aborted.\n" | ||
| 15 | if length($content) == 0; | ||
| 16 | |||
| 17 | $self->set_prop(content => $content); | ||
| 18 | $self->SUPER::run(@_); | ||
| 19 | }; | ||
| 20 | |||
| 21 | __PACKAGE__->meta->make_immutable; | ||
| 22 | no Any::Moose; | ||
| 23 | |||
| 24 | 1; | ||
| 25 |