From af3e8596bd62c780f35357b97fb45829dd456c2f Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Sun, 24 Mar 2024 17:22:18 +0100 Subject: support multiple via stops --- bin/hafas | 12 ++++------ lib/Travel/Routing/DE/HAFAS.pm | 53 ++++++++++++++++++------------------------ 2 files changed, 26 insertions(+), 39 deletions(-) diff --git a/bin/hafas b/bin/hafas index ccbd88f..5f4e1a3 100755 --- a/bin/hafas +++ b/bin/hafas @@ -77,12 +77,8 @@ if ($list_services) { parse_mot_options(); -my ( $from_stop, $via_stop, $to_stop ) = @ARGV; - -if ( $via_stop and not $to_stop ) { - $to_stop = $via_stop; - $via_stop = undef; -} +my ( $from_stop, @via_stops ) = @ARGV; +my $to_stop = pop @via_stops; if ( not( $from_stop and $to_stop ) ) { show_help(1); @@ -91,7 +87,7 @@ if ( not( $from_stop and $to_stop ) ) { my %opt = ( service => $service, from_stop => $from_stop, - via_stop => $via_stop, + via_stops => \@via_stops, to_stop => $to_stop, excluded_mots => \@excluded_mots, exclusive_mots => \@exclusive_mots, @@ -456,7 +452,7 @@ hafas - Interface to HAFAS (e.g. Deutsche Bahn) itinerary services =head1 SYNOPSIS B [B<-d> I] [B<-t> I