/usr/share/perl5/App/Asciio/Options.pm is in asciio 1.02.71-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 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 | package App::Asciio ;
$|++ ;
use strict;
use warnings;
use Data::TreeDumper ;
use Getopt::Long ;
#-----------------------------------------------------------------------------
sub ParseSwitches
{
my ($self, $switches_to_parse, $ignore_error) = @_ ;
my $asciio_config = {} ;
Getopt::Long::Configure('no_auto_abbrev', 'no_ignore_case', 'require_order') ;
my @flags = Get_GetoptLong_Data($asciio_config) ;
@ARGV = @{$switches_to_parse} ;
# tweek option parsing so we can mix switches with targets
my $contains_switch ;
my @targets ;
do
{
while(@ARGV && $ARGV[0] !~ /^-/)
{
#~ print "target => $ARGV[0] \n" ;
push @targets, shift @ARGV ;
}
$contains_switch = @ARGV ;
local $SIG{__WARN__} = sub {print STDERR $_[0] unless $ignore_error ;} ;
unless(GetOptions(@flags))
{
return(0, "Try perl asciio -h.", $asciio_config, @ARGV) unless $ignore_error;
}
}
while($contains_switch) ;
$asciio_config->{TARGETS} = \@targets ;
#~ use Data::TreeDumper ;
#~ print DumpTree $asciio_config ;
return(1, '', $asciio_config) ;
}
#-------------------------------------------------------------------------------
sub Get_GetoptLong_Data
{
my $asciio_config = shift || die 'Missing argument.' ;
my @flags_and_help = GetSwitches($asciio_config) ;
my $flag_element_counter = 0 ;
my @getoptlong_data ;
for (my $i = 0 ; $i < @flags_and_help; $i += 4)
{
my ($flag, $variable) = ($flags_and_help[$i], $flags_and_help[$i + 1]) ;
push @getoptlong_data, ($flag, $variable) ;
}
return(@getoptlong_data) ;
}
#-------------------------------------------------------------------------------
sub GetSwitches
{
my $asciio_config = shift || {} ;
$asciio_config->{SETUP_PATH} = undef ;
my @flags_and_help =
(
'setup_path=s' => \$asciio_config->{SETUP_PATH},
'Sets the root of the setup directory.',
'',
's|script=s' => \$asciio_config->{SCRIPT},
'script to be run at AsciiO start.',
'',
'h|help' => \$asciio_config->{HELP},
'Displays some help.',
'',
) ;
return(@flags_and_help) ;
}
#-----------------------------------------------------------------------------
1 ;
|