From: martinahansen Date: Wed, 9 Jul 2008 11:02:33 +0000 (+0000) Subject: fixed print_usage X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=832df056329aa348ccedba3f2c96a313014433a7;p=biopieces.git fixed print_usage git-svn-id: http://biopieces.googlecode.com/svn/trunk@140 74ccb610-7750-0410-82ae-013aeee3265d --- diff --git a/code_perl/Maasha/Biopieces.pm b/code_perl/Maasha/Biopieces.pm index a0d480f..7badb51 100644 --- a/code_perl/Maasha/Biopieces.pm +++ b/code_perl/Maasha/Biopieces.pm @@ -262,7 +262,7 @@ sub get_options # Gets options from commandline and checks these vigerously. - my ( $script, # name of script + my ( $script, # name of script ) = @_; # Returns hash @@ -893,9 +893,13 @@ sub get_options @options, ); -# print STDERR Dumper( \%options ) and exit; + $options{ "script" } = $script; - $options{ "script" } = $script; +# print STDERR Dumper( \%options ); + + if ( scalar( keys %options ) == 1 or $options{ "help" } ) { + return wantarray ? %options : \%options; + } $options{ "cols" } = [ split ",", $options{ "cols" } ] if defined $options{ "cols" }; $options{ "keys" } = [ split ",", $options{ "keys" } ] if defined $options{ "keys" };