From 506b66a84c4ec39d69c74f9a42d4f100909ac4a0 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Wed, 29 Apr 2015 17:39:40 +0200 Subject: add support for timeouts, do not die if XML tree parsing failed --- bin/efa-m | 3 +++ 1 file changed, 3 insertions(+) (limited to 'bin') diff --git a/bin/efa-m b/bin/efa-m index 8c4341c..5b7a1b6 100755 --- a/bin/efa-m +++ b/bin/efa-m @@ -16,6 +16,7 @@ use Travel::Status::DE::EFA; my $efa_url = 'http://efa.vrr.de/vrr/XSLT_DM_REQUEST'; my ( $date, $time, $input_type, $list_lines, $offset, $relative_times ); +my ($timeout); my ( @grep_lines, @grep_platforms ); @ARGV = map { decode( 'UTF-8', $_ ) } @ARGV; @@ -29,6 +30,7 @@ GetOptions( 'p|platform=s@' => \@grep_platforms, 'r|relative' => \$relative_times, 't|time=s' => \$time, + 'timeout=i' => \$timeout, 'u|efa-url=s' => \$efa_url, 'V|version' => \&show_version, @@ -55,6 +57,7 @@ my $status = Travel::Status::DE::EFA->new( name => $input, time => $time, type => $input_type, + timeout => $timeout // 10, ); sub show_help { -- cgit v1.2.3