/usr/share/perl5/MooseX/App/Plugin/Term/Meta/Class.pm is in libmoosex-app-perl 1.37-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | # ============================================================================
package MooseX::App::Plugin::Term::Meta::Class;
# ============================================================================
use 5.010;
use utf8;
use namespace::autoclean;
use Moose::Role;
use IO::Interactive qw(is_interactive);
around 'command_check_attributes' => sub {
my ($orig,$self,$command_meta,$errors,$params) = @_;
$command_meta ||= $self;
if (scalar @{$errors} == 0
&& is_interactive()) {
my $prompt = 1;
foreach my $attribute ($self->command_usage_attributes($command_meta,'all')) {
if ($attribute->is_required
&& ! exists $params->{$attribute->name}
&& (! $attribute->can('cmd_term') || $attribute->cmd_term == 0 )) {
$prompt = 0;
}
}
if ($prompt) {
foreach my $attribute ($self->command_usage_attributes($command_meta,'all')) {
next
unless $attribute->can('cmd_term')
&& $attribute->cmd_term;
if (! defined $params->{$attribute->name}) {
my $return = $attribute->cmd_term_read();
$params->{$attribute->name} = $return
if defined $return;
}
}
}
}
return $self->$orig($command_meta,$errors,$params);
};
1;
|