diff options
author | Nicolas Vigier <boklm@mageia.org> | 2013-06-13 12:44:46 +0000 |
---|---|---|
committer | Nicolas Vigier <boklm@mageia.org> | 2013-06-13 12:44:46 +0000 |
commit | fb758e7d3056263966a7c02b8fd86ee6629f1244 (patch) | |
tree | 3292894ff9f51afe9fe3f373cb10e6250c07cb96 | |
parent | 0be9f48b2fd34fec24c64719ac991d9e7742e515 (diff) | |
download | mgaadvisories-fb758e7d3056263966a7c02b8fd86ee6629f1244.tar mgaadvisories-fb758e7d3056263966a7c02b8fd86ee6629f1244.tar.gz mgaadvisories-fb758e7d3056263966a7c02b8fd86ee6629f1244.tar.bz2 mgaadvisories-fb758e7d3056263966a7c02b8fd86ee6629f1244.tar.xz mgaadvisories-fb758e7d3056263966a7c02b8fd86ee6629f1244.zip |
Remove %usage
-rwxr-xr-x | mgaadv | 35 |
1 files changed, 19 insertions, 16 deletions
@@ -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); |