X-Git-Url: https://git.donarmstrong.com/?p=function2gene.git;a=blobdiff_plain;f=bin%2Fparse_genecard_results;h=6024d9bd27e0f9d74618070735532cb6dd051da1;hp=4c00d9b47b85b44ef07adb66042f224cd6513e45;hb=2f7bfa126e44399e0d7c3f3b755afbe895ac6e3a;hpb=d09b67e0af77d6f2818e41d6b4d648cff651c79d 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"; }