From 694ed54c50405488d90983e0f603f6636dcf91b9 Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Sat, 9 Feb 2008 19:50:32 +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@1527 95ad53e4-c205-0410-b2fa-d234c58c8868 --- os-plugins/slxos-plugin | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'os-plugins/slxos-plugin') diff --git a/os-plugins/slxos-plugin b/os-plugins/slxos-plugin index 52c80796..6797b25e 100755 --- a/os-plugins/slxos-plugin +++ b/os-plugins/slxos-plugin @@ -34,23 +34,23 @@ use OpenSLX::Basics; use OpenSLX::OSPlugin::Engine; use OpenSLX::Utils; -my ($helpReq, $manReq, $verbose, $versionReq,); +my %option; GetOptions( - 'help|?' => \$helpReq, - 'man' => \$manReq, - 'verbose' => \$verbose, - 'version' => \$versionReq, + 'help|?' => \$option{helpReq}, + 'man' => \$option{manReq}, + 'verbose' => \$option{verbose}, + 'version' => \$option{versionReq}, ) or pod2usage(2); -pod2usage(-msg => $abstract, -verbose => 0, -exitval => 1) if $helpReq; -if ($manReq) { +pod2usage(-msg => $abstract, -verbose => 0, -exitval => 1) if $option{helpReq}; +if ($option{manReq}) { # avoid dubious problem with perldoc in combination with UTF-8 that # leads to strange dashes and single-quotes being used $ENV{LC_MESSAGES} = 'POSIX'; pod2usage(-verbose => 2); } -if ($versionReq) { +if ($option{versionReq}) { system('slxversion'); exit 1; } @@ -67,7 +67,7 @@ if ($action =~ m[^list]i) { print join( '', map { - if ($verbose) { + if ($option{verbose}) { my $description = $pluginInfo->{$_}->{description}; $description .= "\t " -- cgit v1.2.3-55-g7522