summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2013-08-17 18:30:25 +0200
committerDaniel Friesel <derf@finalrewind.org>2013-08-17 18:30:25 +0200
commitf6490ac30e225d1fb2975f4f0ff8401eb95f8063 (patch)
treea27a621be0d187bd161230edcba97685658de67c
parentd7c458cc262709bfa7cfc0c75b2e8bb77527273a (diff)
add -a / --arrivals option
-rwxr-xr-xbin/db-ris16
1 files 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<db-ris> [B<-d> I<date>] [B<-L>] [B<-m> I<motlist>] [B<-t> I<time>]
+B<db-ris> [B<-a>] [B<-d> I<date>] [B<-L>] [B<-m> I<motlist>] [B<-t> I<time>]
[B<-v> I<via>] I<station>
=head1 VERSION
@@ -159,6 +162,13 @@ departure screens installed at most main stations.
=over
+=item B<-a>, B<--arrivals>
+
+Show arrivals instead of departures, including trains ending at the specified
+station. Note that this causes the output to display the start instead of
+the end station and B<-f> to list all stops between start end
+I<station>, not I<station> and end.
+
=item B<-d>, B<--date> I<dd>.I<mm>.I<yyyy>
Date to list departures for. Default: today.