X-Git-Url: https://git.donarmstrong.com/?p=function2gene.git;a=blobdiff_plain;f=bin%2Fparse_genecard_results;h=6024d9bd27e0f9d74618070735532cb6dd051da1;hp=4c00d9b47b85b44ef07adb66042f224cd6513e45;hb=79c0f28d89ba108bcfca68a8b5d4f0e3855455dc;hpb=672a430873e686b884bccb1b027321658c541b25 diff --git a/bin/parse_genecard_results b/bin/parse_genecard_results index 4c00d9b..6024d9b 100755 --- a/bin/parse_genecard_results +++ b/bin/parse_genecard_results @@ -70,16 +70,17 @@ BEGIN{ use IO::File; use IO::Dir; -# XXX parse config file - my %options = (debug => 0, help => 0, man => 0, dir => '.', keyword => undef, + keywords => 0, ); -GetOptions(\%options,'keyword|k=s','dir|D=s','debug|d+','help|h|?','man|m'); +GetOptions(\%options,'keyword|k=s','dir|D=s','debug|d+','help|h|?','man|m', + 'keywords', + ); pod2usage() if $options{help}; @@ -99,6 +100,13 @@ use constant {NAME => 0, FILENAME => 8, }; +if ($options{keywords}) { + if (@ARGV != 1) { + pod2usage("If the --keywords option is used, exactly one argument (the keyword) must be passed"); + } + $option{dir} = "$ARGV[0]_results_genecard"; +} + if (not -d $options{dir}) { die "$options{dir} does not exist or is not a directory"; }