/usr/share/perl5/App/SD/CLI.pm is in sd 0.75-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 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 | #!/usr/bin/env perl
package App::SD::CLI;
use Any::Moose;
extends 'Prophet::CLI';
use App::SD;
use App::SD::CLI::Dispatcher;
has '+app_class' => (
default => 'App::SD',
);
sub dispatcher_class { "App::SD::CLI::Dispatcher" }
sub format_change {
my $self = shift;
my %args = (
change => undef,
header_callback => undef,
@_
);
my $output = $args{header_callback} ? $args{header_callback}->( $args{change} ) : '' ;
if ( $args{change}->record_type eq 'comment' && $args{change}->change_type eq 'add_file' ) {
my $change = $args{change}->as_hash;
$output .= App::SD::CLI::Command::Ticket::Show->format_comment(
( ( $change->{prop_changes}->{'content_type'} && $change->{prop_changes}->{'content_type'}->{new_value} )
? $change->{prop_changes}->{'content_type'}->{new_value}
: 'text/plain'
),
$change->{prop_changes}->{'content'}->{new_value}
);
} else {
if ( my @prop_changes = $args{change}->prop_changes ) {
$output .= $args{change_header}->( $args{change} ) if ( $args{change_header} );
$output .= App::SD::CLI->format_prop_changes( \@prop_changes );
}
}
return $output . "\n";
}
sub format_prop_changes {
my $self = shift;
my $prop_changes = shift;
my $output;
for (@$prop_changes) {
if ( defined $_->new_value && defined $_->old_value ) {
$output .= sprintf( "%18.18s", $_->name ) . ": changed from " . $_->old_value . " to " . $_->new_value;
} elsif ( defined $_->new_value ) {
$output .= sprintf( "%18.18s", $_->name ) . ": set to " . $_->new_value;
} elsif ( defined $_->old_value ) {
$output .= sprintf( "%18.18s", $_->name ) . ": " . $_->old_value . " deleted";
} else {
next;
}
$output .= "\n";
}
return $output;
}
__PACKAGE__->meta->make_immutable;
no Any::Moose;
1;
|