summaryrefslogtreecommitdiff
path: root/bin/db-ris
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2011-09-04 13:27:01 +0200
committerDaniel Friesel <derf@finalrewind.org>2011-09-04 13:27:01 +0200
commit8f6e84a46ebcbec90630bdaf39b935f71114c80d (patch)
tree2f279c077c2928e9577c69bcc45475e743666022 /bin/db-ris
parentca37cdd0009298b677ffbc356741098d609c474d (diff)
db-ris: Add -f/--full-route option
Diffstat (limited to 'bin/db-ris')
-rwxr-xr-xbin/db-ris31
1 files changed, 24 insertions, 7 deletions
diff --git a/bin/db-ris b/bin/db-ris
index 3dea411..d9ad07b 100755
--- a/bin/db-ris
+++ b/bin/db-ris
@@ -13,8 +13,9 @@ my %train_type;
my ( $date, $time );
my $filter_via;
-my $ignore_late = 0;
-my $types = q{};
+my $ignore_late = 0;
+my $show_full_route = 0;
+my $types = q{};
my @output;
@@ -22,6 +23,7 @@ binmode( STDOUT, ':encoding(utf-8)' );
GetOptions(
'd|date=s' => \$date,
+ 'f|full-route' => \$show_full_route,
'h|help' => sub { show_help(0) },
'L|ignore-late' => \$ignore_late,
'm|mot=s' => \$types,
@@ -77,8 +79,14 @@ sub display_result {
}
for my $line (@lines) {
- printf( join( q{ }, ( map { "%-${_}s" } @line_length ) ) . "\n",
- @{$line}, );
+ printf(
+ join( q{ }, ( map { "%-${_}s" } @line_length ) ) . "\n",
+ @{$line}[ 0 .. 5 ]
+ );
+
+ if ($show_full_route) {
+ print "\n" . $line->[6] . "\n\n\n";
+ }
}
return;
@@ -106,9 +114,14 @@ for my $d ( $status->results() ) {
push(
@output,
[
- $d->time, $d->train,
- join( q{ }, $d->route_interesting ), $d->destination,
- $d->platform, $d->info,
+ $d->time,
+ $d->train,
+ join( q{ }, $d->route_interesting ),
+ $d->destination,
+ $d->platform,
+ $d->info,
+ join( "\n",
+ map { sprintf( '%-5s %s', @{$_} ) } $d->route_timetable ),
]
);
}
@@ -147,6 +160,10 @@ departure screens installed at most main stations.
Date to list departures for. Default: today.
+=item B<-f>, B<--full-route>
+
+Display complete routes (including arrival times) of all trains.
+
=item B<-L>, B<--ignore-late>
Do not display delayed trains.