From 8c7b014e76fcf6f05885bf72f6bf46e258404b7e Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Thu, 24 Dec 2009 21:15:31 +0100 Subject: efa: Allow stop-specification as addr:stop and poi:stop --- bin/efa | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) 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 for from/to/via. Possible Is: B (default), B
, B (point of interest) +As an alternative to these options, it is possible to specify the I +of the to/from/via options as "addr:I" or "poi:I", respectively. + =item B<--time>|B<--depart> I:I Journey start time -- cgit v1.2.3