summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorOliver Tappe2008-02-09 20:44:09 +0100
committerOliver Tappe2008-02-09 20:44:09 +0100
commit25eca7fb4ca0eb27fd852cea88caad416536ad97 (patch)
tree7e327515be170f5aae3bf7653ca00b96a2f7ae65 /bin
parent* cmdline options are now collected in a hash instead of individual variables, (diff)
downloadcore-25eca7fb4ca0eb27fd852cea88caad416536ad97.tar.gz
core-25eca7fb4ca0eb27fd852cea88caad416536ad97.tar.xz
core-25eca7fb4ca0eb27fd852cea88caad416536ad97.zip
* 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
Diffstat (limited to 'bin')
-rwxr-xr-xbin/slxldd36
1 files changed, 14 insertions, 22 deletions
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);