From f6490ac30e225d1fb2975f4f0ff8401eb95f8063 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sat, 17 Aug 2013 18:30:25 +0200 Subject: add -a / --arrivals option --- bin/db-ris | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/bin/db-ris b/bin/db-ris index 4a90d52..cafe7b7 100755 --- a/bin/db-ris +++ b/bin/db-ris @@ -12,6 +12,7 @@ use Travel::Status::DE::DeutscheBahn; my %train_type; my ( $date, $time ); +my $arrivals = 0; my $filter_via; my $ignore_late = 0; my $show_full_route = 0; @@ -23,6 +24,7 @@ my @output; binmode( STDOUT, ':encoding(utf-8)' ); GetOptions( + 'a|arrivals' => \$arrivals, 'd|date=s' => \$date, 'f|full-route' => \$show_full_route, 'h|help' => sub { show_help(0) }, @@ -50,6 +52,7 @@ my $status = Travel::Status::DE::DeutscheBahn->new( mot => \%train_type, station => shift || show_help(1), time => $time, + mode => $arrivals ? 'arr' : 'dep', ); sub show_help { @@ -119,8 +122,8 @@ for my $d ( $status->results() ) { [ $d->time, $d->train, - join( q{ }, $d->route_interesting ), - $d->destination, + $arrivals ? q{} : join( q{ }, $d->route_interesting ), + $d->route_end, $d->platform, $d->info, join( "\n", @@ -139,7 +142,7 @@ db-ris - Interface to the DeutscheBahn online departure monitor =head1 SYNOPSIS -B [B<-d> I] [B<-L>] [B<-m> I] [B<-t> I