diff options
author | hieuhoang1972 <hieuhoang1972@9a26d1b7-1c8f-445c-8fdd-6576f508279d> | 2012-05-28 15:26:02 +0400 |
---|---|---|
committer | hieuhoang1972 <hieuhoang1972@9a26d1b7-1c8f-445c-8fdd-6576f508279d> | 2012-05-28 15:26:02 +0400 |
commit | b0140cf4052ba8454cf0e116c92bd06c8b9d9042 (patch) | |
tree | 3f2ea09891c5f294279ae928cc5407b5597866ee | |
parent | ef56f04e38f2215fbca22db8657a06d0f3a5e525 (diff) |
have optional args at the beginning of the arg list. Easier to integrate with EMS
-rwxr-xr-x | mgizapp/scripts/snt2cooc.pl | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/mgizapp/scripts/snt2cooc.pl b/mgizapp/scripts/snt2cooc.pl index 490a688..5bbefab 100755 --- a/mgizapp/scripts/snt2cooc.pl +++ b/mgizapp/scripts/snt2cooc.pl @@ -1,6 +1,6 @@ -#!/usr/bin/perl -w +#!/usr/bin/perl -w -# sntcooc.perl output vcb1 vcb2 snt12 +# sntcooc.perl [-sort-buffer-size 200M] [-sort-batch-size 253] [-sort-compress gzip] output vcb1 vcb2 snt12 use strict; use File::Basename; @@ -8,29 +8,29 @@ use FindBin qw($Bin); sub systemCheck($); -my $out = $ARGV[0]; -my $vcb1 = $ARGV[1]; -my $vcb2 = $ARGV[2]; -my $snt12 = $ARGV[3]; my $sortArgs = ""; - -for (my $i = 4; $i < @ARGV; ++$i) +for (my $i = 0; $i < (@ARGV - 4); ++$i) { my $arg = $ARGV[$i]; if ($arg eq "-sort-buffer-size") { - $sortArgs .= "-S " .$ARGV[++$i]; + $sortArgs .= " -S " .$ARGV[++$i]; } elsif ($arg eq "-sort-batch-size") { - $sortArgs .= "--batch-size " .$ARGV[++$i]; + $sortArgs .= " --batch-size " .$ARGV[++$i]; } elsif ($arg eq "-sort-compress") { - $sortArgs .= "--compress-program " .$ARGV[++$i]; + $sortArgs .= " --compress-program " .$ARGV[++$i]; } } +my $out = $ARGV[@ARGV - 4]; +my $vcb1 = $ARGV[@ARGV - 3]; +my $vcb2 = $ARGV[@ARGV - 2]; +my $snt12 = $ARGV[@ARGV - 1]; + my $SORT_EXEC = `gsort --help 2>/dev/null`; if($SORT_EXEC) { $SORT_EXEC = 'gsort'; |