diff options
Diffstat (limited to 'mgaadv')
-rwxr-xr-x | mgaadv | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -111,6 +111,15 @@ $0 show [ID] Show an advisory. END }, + showjson => { + run => \&showadvjson, + descr => 'Show an advisory in JSON format', + usage => <<END, +$0 showjson [ID] + +Show an advisory in JSON format. +END + }, update => { run => \&updateadv, descr => 'Update the advisories database', @@ -219,6 +228,14 @@ sub showadv { MGA::Advisories::showadv(\%advdb, $adv); } +sub showadvjson { + usageexit('usage', $_[0]) unless @_ == 2; + my $adv = $_[1]; + my %advdb; + $advdb{advisories} = MGA::Advisories::get_advisories(); + MGA::Advisories::showadvjson(\%advdb, $adv); +} + sub updateadv { usageexit('usage', $_[0]) unless @_ == 1; MGA::Advisories::download_advisories; |