| 1 | package App::SD::CLI::Command::Ticket::Attachment::Create; | ||
| 2 | use Any::Moose; | ||
| 3 | extends 'App::SD::CLI::Command::Attachment::Create'; | ||
| 4 | |||
| 5 | sub ARG_TRANSLATIONS { shift->SUPER::ARG_TRANSLATIONS(), f => 'file' }; | ||
| 6 | |||
| 7 | sub usage_msg { | ||
| 8 | my $self = shift; | ||
| 9 | my ($cmd, $type_and_subcmd) = $self->get_cmd_and_subcmd_names; | ||
| 10 | |||
| 11 | return <<"END_USAGE"; | ||
| 12 | usage: ${cmd}${type_and_subcmd} <record-id> [--file <filename>] | ||
| 13 | END_USAGE | ||
| 14 | } | ||
| 15 | |||
| 16 | # override args to feed in that ticket's uuid as an argument to the comment | ||
| 17 | sub run { | ||
| 18 | my $self = shift; | ||
| 19 | |||
| 20 | $self->print_usage if $self->has_arg('h'); | ||
| 21 | |||
| 22 | $self->require_uuid; | ||
| 23 | |||
| 24 | $self->set_prop(ticket => $self->uuid); | ||
| 25 | $self->SUPER::run(@_); | ||
| 26 | }; | ||
| 27 | |||
| 28 | __PACKAGE__->meta->make_immutable; | ||
| 29 | no Any::Moose; | ||
| 30 | |||
| 31 | 1; | ||
| 32 |