summaryrefslogtreecommitdiff
path: root/bin/db-iris
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2014-01-03 19:12:53 +0100
committerDaniel Friesel <derf@finalrewind.org>2014-01-03 19:12:53 +0100
commitbdfd43c81227c9e88c92ee145b5448463eeed276 (patch)
tree2d28607f36c75b1faa11516797bb05fa60b504db /bin/db-iris
parent6a8f2dcb7938dc7883591eaec871878603be1839 (diff)
parse info and delay messages
Diffstat (limited to 'bin/db-iris')
-rwxr-xr-xbin/db-iris20
1 files changed, 15 insertions, 5 deletions
diff --git a/bin/db-iris b/bin/db-iris
index 3ae2a45..dba21a7 100755
--- a/bin/db-iris
+++ b/bin/db-iris
@@ -108,18 +108,18 @@ sub display_result {
die("Nothing to show\n");
}
- for my $i ( 0 .. 4 ) {
+ for my $i ( 0 .. 5 ) {
$line_length[$i] = max map { length( $_->[$i] ) } @lines;
}
for my $line (@lines) {
printf(
join( q{ }, ( map { "%-${_}s" } @line_length ) ) . "\n",
- @{$line}[ 0 .. 4 ]
+ @{$line}[ 0 .. 5 ]
);
if ($show_full_route) {
- print "\n" . $line->[5] . "\n\n\n";
+ print "\n" . $line->[6] . "\n\n\n";
}
}
@@ -145,12 +145,22 @@ for my $d ( $status->results() ) {
next;
}
+ my $delay = q{};
+
+ if ( $d->delay ) {
+ $delay = ' +' . $d->delay;
+ }
+
push(
@output,
[
- $d->time, $d->train,
+ $d->time . $delay,
+ $d->train,
$arrivals ? q{} : join( q{ }, $d->route_interesting ),
- $d->route_end, $d->platform, join( "\n", $d->route ),
+ $d->route_end,
+ $d->platform,
+ join( ' -- ', $d->info ),
+ join( "\n", $d->route ),
]
);
}