diff options
author | J Pipkin <j@dawnrazor.net> | 2012-09-09 00:07:01 -0500 |
---|---|---|
committer | J Pipkin <j@dawnrazor.net> | 2012-09-09 00:07:01 -0500 |
commit | 06c3247f55cf5ec1d1c8cd9b67a4852344a86eb6 (patch) | |
tree | 29685e8ffda1961d837684a2b9126e07833267e4 | |
parent | 50b40919437babf51d78944b912d559d353040e5 (diff) | |
download | sbotools2-06c3247f55cf5ec1d1c8cd9b67a4852344a86eb6.tar.xz |
fixed incorrect usage of hash in GetOptions
-rwxr-xr-x | sboconfig | 23 |
1 files changed, 7 insertions, 16 deletions
@@ -45,22 +45,13 @@ Config options (defaults shown): EOF } -my ($help, $vers, $list); -my %settings; - -GetOptions ( - 'help|h' => \$help, - 'version|v' => \$vers, - 'list|l' => \$list, - \%settings => 'noclean|c=s', - \%settings => 'distclean|d=s', - \%settings => 'jobs|j=s', - \%settings => 'pkg-dir|p=s', - \%settings => 'sbo-home|s=s', -); +my %options; + +GetOptions (\%options, 'help|h', 'version|v', 'list|l', 'noclean|c=s', + 'distclean|d=s', 'jobs|j=s', 'pkg-dir|p=s', 'sbo-home|s=s'); -show_usage and exit 0 if $help; -show_version and exit 0 if $vers; +show_usage and exit 0 if exists $options{help}; +show_version and exit 0 if exists $options{version}; my %valid_confs = ( noclean => 'NOCLEAN', @@ -78,7 +69,7 @@ if ($list) { exit 0; } -show_usage and exit 0 unless %settings; +show_usage and exit 0 unless keys %options > 0; # setup what's being changed, sanity check. my %changes; |