From d0ce0d83544a26e2976c418517679558799e5599 Mon Sep 17 00:00:00 2001 From: Raphael Geissert Date: Wed, 1 Oct 2014 21:15:25 +0200 Subject: [PATCH] Allow the format and ignore-v6-routes options as CLI options --- zebra-dump-parser.pl | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/zebra-dump-parser.pl b/zebra-dump-parser.pl index 52243e0..4fd35d7 100755 --- a/zebra-dump-parser.pl +++ b/zebra-dump-parser.pl @@ -15,10 +15,18 @@ use strict; require 5.008; +use Getopt::Long; + # only meaningful for message types TABLE_DUMP and TABLE_DUMP_V2 # 1: verbose dump 2: AS path 3: origin AS -my $format = 3; -my $ignore_v6_routes = 1; +my $format = 0; +my $ignore_v6_routes = undef; + +GetOptions('format=i' => \$format, + 'ignore-v6-routes!' => \$ignore_v6_routes) or exit 1; + +$format = 3 if ($format < 1 || $format > 3); +$ignore_v6_routes = 1 unless (defined($ignore_v6_routes)); ############################################################################## use constant {