From 832df056329aa348ccedba3f2c96a313014433a7 Mon Sep 17 00:00:00 2001 From: martinahansen Date: Wed, 9 Jul 2008 11:02:33 +0000 Subject: [PATCH] fixed print_usage git-svn-id: http://biopieces.googlecode.com/svn/trunk@140 74ccb610-7750-0410-82ae-013aeee3265d --- code_perl/Maasha/Biopieces.pm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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" }; -- 2.39.5