From 10d0a26465811b44c211de6dfa11103df81706ec Mon Sep 17 00:00:00 2001 From: Shawn Boyette Date: Tue, 26 Aug 2008 20:13:29 +0000 Subject: [PATCH] implementing --incoming, --incumbent shortcuts --- fingerprinter | 28 ++++++++++++++++++++++++---- 1 files changed, 24 insertions(+), 4 deletions(-) diff --git a/fingerprinter b/fingerprinter index 06af0ff..46759b9 100755 --- a/fingerprinter +++ b/fingerprinter @@ -286,6 +286,8 @@ sub initialize { binmode(STDIN, ':utf8'); my $rc = GetOptions( $c, + 'incoming', + 'incumbent', 'exception|x=s', 'output|o=s', 'runtype|r=s', @@ -295,6 +297,20 @@ sub initialize { 'help|h', ); show_help() unless $rc; + show_help() if ($c->{help}); + + # set defaults if told to do so + if ($c->{incoming}) { + $c->{tag} = 903; + $c->{subfield} = 'a'; + $c->{output} = 'incoming.fp'; + $c->{exception} = 'incoming.ex'; + } elsif ($c->{incumbent}) { + $c->{tag} = 901; + $c->{subfield} = 'c'; + $c->{output} = 'incumbent.fp'; + $c->{exception} = 'incumbent.ex'; + } my @keys = keys %{$c}; show_help() unless (@ARGV and @keys); @@ -304,8 +320,6 @@ sub initialize { print "Required option: ", join(', ', @missing), " missing!\n"; show_help(); } - - show_help() if ($c->{help}); } @@ -327,7 +341,7 @@ Display usage message when things go wrong sub show_help { print < +Usage is: $0 [REQUIRED ARGS] [OPTIONS] Req'd Arguments --runtype=(primary|full) -r Do 'primary' or 'full' fingerprinting --tag=N -t Which tag to use @@ -335,7 +349,13 @@ Req'd Arguments --output= -o Output filename --exceptions= -x Exception report filename Options - --quiet -q Don't write status messages to STDOUT + --incoming Set -r to 'full'; -t, -s, -o, -x to incoming defaults + --incumbent Set -r to 'full'; -t, -s, -o, -x to incumbent defaults + + Example: '$0 --incoming' is equivalent to + '$0 -r full -t 903 -s a -o incoming.fp -x incoming.ex' + + --quiet -q Don't write status messages to STDOUT HELP exit 1; } -- 1.7.2.5