aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Vigier <boklm@mageia.org>2013-06-13 12:44:46 +0000
committerNicolas Vigier <boklm@mageia.org>2013-06-13 12:44:46 +0000
commitfb758e7d3056263966a7c02b8fd86ee6629f1244 (patch)
tree3292894ff9f51afe9fe3f373cb10e6250c07cb96
parent0be9f48b2fd34fec24c64719ac991d9e7742e515 (diff)
downloadmgaadvisories-fb758e7d3056263966a7c02b8fd86ee6629f1244.tar
mgaadvisories-fb758e7d3056263966a7c02b8fd86ee6629f1244.tar.gz
mgaadvisories-fb758e7d3056263966a7c02b8fd86ee6629f1244.tar.bz2
mgaadvisories-fb758e7d3056263966a7c02b8fd86ee6629f1244.tar.xz
mgaadvisories-fb758e7d3056263966a7c02b8fd86ee6629f1244.zip
Remove %usage
-rwxr-xr-xmgaadv35
1 files changed, 19 insertions, 16 deletions
diff --git a/mgaadv b/mgaadv
index 99371e9..40a5742 100755
--- a/mgaadv
+++ b/mgaadv
@@ -5,33 +5,36 @@ use MGA::Advisories;
use Template;
my %actions = (
- mksite => \&mksite,
- new => \&newadv,
- usage => \&usage,
-);
-
-my %usage = (
- mksite => <<END,
+ mksite => {
+ run => \&mksite,
+ usage => <<END,
$0 mksite
Generates the advisories web site
END
- usage => <<END,
-$0 usage [action]
-
-Show action usage
-END
- new => <<END,
+ },
+ new => {
+ run => \&newadv,
+ usage => <<END,
$0 new [type] [bugnum]
Create a new advisory file. [type] should be security or bugfix and
[bugnum] is the bugzilla bug number.
END
+ },
+ usage => {
+ run => \&usage,
+ usage => <<END,
+$0 usage [action]
+
+Show action usage
+END
+ },
);
sub usage {
- if ($_[1] && $usage{$_[1]}) {
- print STDERR $usage{$_[1]};
+ if ($_[1] && $actions{$_[1]}) {
+ print STDERR $actions{$_[1]}->{usage};
} else {
print STDERR "$0 [action] [options]\n";
print STDERR "$0 usage [action]\n\n";
@@ -68,5 +71,5 @@ sub newadv {
if (@ARGV == 0 || !$actions{$ARGV[0]}) {
usageexit();
}
-$actions{$ARGV[0]}->(@ARGV);
+$actions{$ARGV[0]}->{run}->(@ARGV);