summaryrefslogtreecommitdiff
path: root/bin/efa
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2009-12-24 21:15:31 +0100
committerDaniel Friesel <derf@derf.homelinux.org>2009-12-24 21:15:31 +0100
commit8c7b014e76fcf6f05885bf72f6bf46e258404b7e (patch)
tree1b0803235572ce1ac41884b2655d52cda573383d /bin/efa
parent5849e2f10e6dcaa652e0bc89cfcc5875ad030cf0 (diff)
efa: Allow stop-specification as addr:stop and poi:stop
Diffstat (limited to 'bin/efa')
-rwxr-xr-xbin/efa26
1 files changed, 26 insertions, 0 deletions
diff --git a/bin/efa b/bin/efa
index c46be10..8f9d8c6 100755
--- a/bin/efa
+++ b/bin/efa
@@ -238,6 +238,29 @@ if (@to != 2 or @from != 2) {
exit 1;
}
+# TODO: More code reuse here
+
+if ($from[1] =~ s/ ^ addr: \s* (.+) $ /$1/x) {
+ $from_type = 'address';
+}
+elsif ($from[1] =~ s/ ^ poi: \s* (.+) $ /$1/x) {
+ $from_type = 'poi';
+}
+
+if (defined $via[1] and $via[1] =~ s/ ^ addr: \s* (.+) $ /$1/x) {
+ $via_type = 'address';
+}
+elsif (defined $via[1] and $via[1] =~ s/ ^ poi: \s* (.+) $ /$1/x) {
+ $via_type = 'poi';
+}
+
+if ($to[1] =~ s/ ^ addr: \s* (.+) $ /$1/x) {
+ $to_type = 'address';
+}
+elsif ($to[1] =~ s/ ^ poi: \s* (.+) $ /$1/x) {
+ $to_type = 'poi';
+}
+
@post{'place_origin', 'name_origin'} = @from;
@post{'place_destination', 'name_destination'} = @to;
if (@via == 2) {
@@ -412,6 +435,9 @@ Travel via this place
Designate type of the I<stop> for from/to/via.
Possible I<type>s: B<stop> (default), B<address>, B<poi> (point of interest)
+As an alternative to these options, it is possible to specify the I<stop>
+of the to/from/via options as "addr:I<stop>" or "poi:I<stop>", respectively.
+
=item B<--time>|B<--depart> I<hh>:I<mm>
Journey start time