aboutsummaryrefslogtreecommitdiffstats
path: root/mgaadv
diff options
context:
space:
mode:
Diffstat (limited to 'mgaadv')
-rwxr-xr-xmgaadv17
1 files changed, 17 insertions, 0 deletions
diff --git a/mgaadv b/mgaadv
index ca519b0..78b1cf3 100755
--- a/mgaadv
+++ b/mgaadv
@@ -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;