summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2013-12-13 08:28:09 +0100
committerDaniel Friesel <derf@finalrewind.org>2013-12-13 08:28:09 +0100
commit1157ac67b6ba95c0b6d7b90f135e7c0abb1001f6 (patch)
tree1203bc7b47e425e9e62634eb05f4562876223f52 /bin
parent0736de7268d9ac8d5edef06cb8838e19d9bfa667 (diff)
add -r / --relative option
Diffstat (limited to 'bin')
-rwxr-xr-xbin/aseag-m47
1 files changed, 34 insertions, 13 deletions
diff --git a/bin/aseag-m b/bin/aseag-m
index 2c4e655..73b5236 100755
--- a/bin/aseag-m
+++ b/bin/aseag-m
@@ -14,8 +14,9 @@ use List::Util qw(max);
use Travel::Status::DE::ASEAG;
my (@grep_lines);
-my $full_route = 0;
-my $hide_past = 1;
+my $full_route = 0;
+my $hide_past = 1;
+my $relative_times = 0;
my $via;
GetOptions(
@@ -25,6 +26,7 @@ GetOptions(
'f|full-route' => \$full_route,
'l|line=s@' => \@grep_lines,
'p|with-past' => sub { $hide_past = 0 },
+ 'r|relative' => \$relative_times,
'v|via=s' => \$via,
'V|version' => \&show_version,
@@ -103,17 +105,32 @@ sub show_results {
next;
}
- push(
- @output,
- [
- $dtime,
- $d->line,
- $d->destination,
- join( "\n",
- map { sprintf( '%-8s %s', @{$_} ) }
- @{ $d->route_timetable } )
- ]
- );
+ if ($relative_times) {
+ push(
+ @output,
+ [
+ $d->line,
+ $d->destination,
+ sprintf( '%3d min', $d->countdown ),
+ join( "\n",
+ map { sprintf( '%-8s %s', @{$_} ) }
+ @{ $d->route_timetable } )
+ ]
+ );
+ }
+ else {
+ push(
+ @output,
+ [
+ $dtime,
+ $d->line,
+ $d->destination,
+ join( "\n",
+ map { sprintf( '%-8s %s', @{$_} ) }
+ @{ $d->route_timetable } )
+ ]
+ );
+ }
}
display_result(@output);
@@ -172,6 +189,10 @@ repeated)
Also show departures in the past. Also appleas to the route information of
B<-a> / B<-b> / B<-f>.
+=item B<-r>, B<--relative>
+
+Use relative departure and route times.
+
=item B<-v>, B<--via> I<stop>
Only show lines which will also service I<stop>. With B<-b>, I<stop> must be