Skip to content

Commit

Permalink
Add script option
Browse files Browse the repository at this point in the history
  • Loading branch information
ramprasadn committed Aug 18, 2021
1 parent ce9b535 commit 8c67490
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/MIP/Program/Gnu/Software/Gnu_awk.pm
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ sub gnu_awk {
## : $filehandle => Filehandle to write to
## : $infile_path => Infile path
## : $outfile_path => Outfile path
## : $script => Script to process infile with
## : $stderrfile_path => Stderrfile path
## : $stderrfile_path_append => Append stderr info to file
## : $stdoutfile_path => Stdoutfile path
Expand All @@ -46,6 +47,7 @@ sub gnu_awk {
my $filehandle;
my $infile_path;
my $outfile_path;
my $script;
my $stderrfile_path;
my $stderrfile_path_append;
my $stdoutfile_path;
Expand All @@ -64,6 +66,10 @@ sub gnu_awk {
store => \$outfile_path,
strict_type => 1,
},
script => {
strict_type => 1,
store => \$script
},
stderrfile_path => { store => \$stderrfile_path, strict_type => 1, },
stderrfile_path_append => { store => \$stderrfile_path_append, strict_type => 1, },
stdoutfile_path => {
Expand All @@ -90,6 +96,11 @@ sub gnu_awk {
push @commands, $infile_path;
}

if ($script) {

push @commands, $script;
}

## Outfile
if ($outfile_path) {

Expand Down
4 changes: 4 additions & 0 deletions t/gnu_awk.t
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,10 @@ my %specific_argument = (
input => q{outfile.test},
expected_output => q{>outfile.test},
},
script => {
input => q{script.test},
expected_output => q{script.test},
},
);

## Coderef - enables generalized use of generate call
Expand Down

0 comments on commit 8c67490

Please sign in to comment.