summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2014-03-05 23:10:27 +0100
committerDaniel Friesel <derf@finalrewind.org>2014-03-05 23:10:27 +0100
commitfd3c07f347c8412d4a7fbb9021b8a04a56328836 (patch)
tree52504edcf40c7c2270e96f5e1cc0aefcf19cda93
parent9f27ebcb7f12860075b3ab4564314bac822d430a (diff)
efa: add -m, --maps option
-rw-r--r--Changelog1
-rwxr-xr-xbin/efa26
2 files changed, 24 insertions, 3 deletions
diff --git a/Changelog b/Changelog
index ea41b1b..e2b35a8 100644
--- a/Changelog
+++ b/Changelog
@@ -1,6 +1,7 @@
git HEAD
* Route::Part: Add {arrival,departure}_{route,station}maps accessors
+ * efa: Add -m, --maps option
Travel::Routing::DE::VRR 2.05 - Mon Mar 03 2014
diff --git a/bin/efa b/bin/efa
index 0bbfda2..f63c9d2 100755
--- a/bin/efa
+++ b/bin/efa
@@ -125,6 +125,12 @@ sub display_connection {
}
}
+ if ( $opt->{maps} ) {
+ for my $m ( $c->departure_routemaps, $c->departure_stationmaps ) {
+ say "# $m";
+ }
+ }
+
printf(
"%-5s ab %-30s %-20s %s\n",
$c->departure_time, $c->departure_stop_and_platform,
@@ -138,9 +144,8 @@ sub display_connection {
}
}
- printf( "%-5s an %s\n\n",
- $c->arrival_time, $c->arrival_stop_and_platform,
- );
+ printf( "%-5s an %s\n", $c->arrival_time, $c->arrival_stop_and_platform, );
+ print "\n";
return;
}
@@ -162,6 +167,7 @@ GetOptions(
full-route|f
help|h
ignore-info|I:s
+ maps|M
max-change|m=i
num-connections|n=i
prefer|P=s
@@ -257,6 +263,15 @@ for my $i ( 0 .. $#routes ) {
for my $c ( $route->parts ) {
display_connection($c);
}
+
+ # last one needs to be shown separately
+ if ( $opt->{maps} ) {
+ my $c = ( $route->parts )[-1];
+ for my $m ( $c->arrival_routemaps, $c->arrival_stationmaps ) {
+ say "# $m";
+ }
+ }
+
if ( $i != $#routes ) {
print "---------\n\n";
}
@@ -345,6 +360,11 @@ these are not always available.
Print connections with at most I<number> interchanges
+=item B<-M>|B<--maps>
+
+Output links to maps of transfer paths and transfer stations where
+available.
+
=item B<-n>|B<--num-connections> I<number>
Return up to I<number> connections. If unset, the default of the respective