From 25eca7fb4ca0eb27fd852cea88caad416536ad97 Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Sat, 9 Feb 2008 19:44:09 +0000 Subject: * cmdline options are now collected in a hash instead of individual variables, as this is much clearer git-svn-id: http://svn.openslx.org/svn/openslx/trunk@1526 95ad53e4-c205-0410-b2fa-d234c58c8868 --- bin/slxldd | 36 ++++++++++++++---------------------- 1 file changed, 14 insertions(+), 22 deletions(-) (limited to 'bin') diff --git a/bin/slxldd b/bin/slxldd index 62bd4752..f7aade3f 100755 --- a/bin/slxldd +++ b/bin/slxldd @@ -37,40 +37,32 @@ use Pod::Usage; use OpenSLX::Basics; use OpenSLX::LibScanner; -my ( - $helpReq, - $manReq, - $verbose, - - $rootPath, - $versionReq, - +my %option = ( + rootPath => '/', ); - -$rootPath = '/'; GetOptions( - 'help|?' => \$helpReq, - 'man' => \$manReq, - 'root-path=s' => \$rootPath, - 'verbose' => \$verbose, - 'version' => \$versionReq, + 'help|?' => \$option{helpReq}, + 'man' => \$option{manReq}, + 'root-path=s' => \$option{rootPath}, + 'verbose' => \$option{verbose}, + 'version' => \$option{versionReq}, ) or pod2usage(2); -pod2usage(-msg => $abstract, -verbose => 0, -exitval => 1) if $helpReq; -pod2usage(-verbose => 2) if $manReq; -if ($versionReq) { +pod2usage(-msg => $abstract, -verbose => 0, -exitval => 1) if $option{helpReq}; +pod2usage(-verbose => 2) if $option{manReq}; +if ($option{versionReq}) { system('slxversion'); exit 1; } openslxInit(); -if (!$rootPath) { +if (!$option{rootPath}) { print STDERR _tr("You need to specify the root-path!\n"); pod2usage(2); } -$rootPath =~ s[/+$][]; +$option{rootPath} =~ s[/+$][]; # remove trailing slashes if (!@ARGV) { @@ -79,8 +71,8 @@ if (!@ARGV) { } my $libScanner = OpenSLX::LibScanner->new({ - 'root-path' => $rootPath, - 'verbose' => $verbose, + 'root-path' => $option{rootPath}, + 'verbose' => $option{verbose}, }); my @libs = $libScanner->determineRequiredLibs(@ARGV); -- cgit v1.2.3-55-g7522