# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-my ( $options, $in, $out, $record, $tmp_dir, $tmp_file, $fh_out, $fh_in, $entry, $chunk, @lines, $line, $s_id, $type, $s_beg, $s_end, $strand, @fields, $def );
+my ( $options, $in, $out, $record, $tmp_dir, $tmp_file, $fh_out, $fh_in, $entry, $chunk, @lines, $line, $s_id, $type, $s_beg, $s_end, $strand, @fields, $def,
+ @commands, $command );
-$options = Maasha::Biopieces::parse_options();
+$options = Maasha::Biopieces::parse_options(
+ [
+ { long => 'full', short => 'f', type => 'flag', mandatory => 'no', default => undef, allowed => undef, disallowed => undef },
+ ]
+);
$in = Maasha::Biopieces::read_stream( $options->{ "stream_in" } );
$out = Maasha::Biopieces::write_stream( $options->{ "stream_out" } );
Maasha::Biopieces::put_record( $record, $out );
}
-if ( $options->{ 'verbise' } ) {
- Maasha::Common::run( "prodigal", "< $tmp_file > $tmp_file.out" );
-} else {
- Maasha::Common::run( "prodigal", "< $tmp_file > $tmp_file.out 2> /dev/null" );
-}
+close $fh_out;
+
+push @commands, "-c" if $options->{ 'full' };
+push @commands, "< $tmp_file > $tmp_file.out";
+push @commands, "2> /dev/null" unless $options->{ 'verbose' };
+
+$command = join " ", @commands;
+
+Maasha::Common::run( "prodigal", $command );
$fh_in = Maasha::Filesys::file_read_open( "$tmp_file.out" );