diff options
author | Daniel Friesel <derf@finalrewind.org> | 2014-01-13 13:41:54 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2014-01-13 13:41:54 +0100 |
commit | 094d5ccf7e3a7b74d33a7b0db16f37e68d86590c (patch) | |
tree | 20edaeb57da8d0802ca808845129e450b22acf92 /bin | |
parent | ef58e86cd740064057186f9a5732f6a62b68bcf1 (diff) |
db-iris: -od: only show most recent delay reason. use -oD for all
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/db-iris | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/bin/db-iris b/bin/db-iris index 530af08..8e5909a 100755 --- a/bin/db-iris +++ b/bin/db-iris @@ -75,6 +75,7 @@ if ($time) { for my $efield (@edata_pre) { given ($efield) { when ('d') { $edata{delay} = 1 } + when ('D') { $edata{delays} = 1 } when ('f') { $edata{fullroute} = 1 } when ('m') { $edata{messages} = 1 } when ('q') { $edata{qos} = 1 } @@ -141,12 +142,17 @@ sub display_result { for my $line (@lines) { printf( - join( q{ }, ( map { "%-${_}s" } @line_length ) ) . "\n", + join( q{ }, ( map { "%-${_}s" } @line_length ) ), @{$line}[ 0 .. 4 ] ); my $d = $line->[5]; + if ( $edata{delay} and $d->delay and $d->delay_messages ) { + printf( ' %s', ( $d->delay_messages )[-1]->[1] ); + } + print "\n"; + if ( $edata{times} ) { if ( not defined $d->delay ) { print "\n"; @@ -293,8 +299,12 @@ Valid output types are: =item d / delay -List all delay reasons entered into the IRIS, even if the train is on time -by now. +If a train is delayed, show the most recent reason for this delay. + +=item d / delays + +List all delay reasons entered into the IRIS for each train, even if the +particular train is on time by now. =item f / fullroute |