Loading Changelog +5 −0 Original line number Original line Diff line number Diff line git HEAD * hafas: Add -C / --change-time option * HAFAS: Add min_change_time option Travel::Routing::DE::HAFAS 0.05 - Sun Mar 24 2024 Travel::Routing::DE::HAFAS 0.05 - Sun Mar 24 2024 * hafas: Add -c / --max-change option * hafas: Add -c / --max-change option Loading bin/hafas +21 −12 Original line number Original line Diff line number Diff line Loading @@ -22,8 +22,9 @@ my ( $json_output, $raw_json_output ); my $show_full_route; my $show_full_route; my ( $list_services, $service ); my ( $list_services, $service ); my ( @excluded_mots, @exclusive_mots ); my ( @excluded_mots, @exclusive_mots ); my $max_change = undef; my $max_change = undef; my $verbosity = 0; my $min_change_time = undef; my $verbosity = 0; my @output; my @output; my %min_verbosity = ( my %min_verbosity = ( Loading @@ -47,6 +48,7 @@ my $output_reset = -t STDOUT ? "\033[0m" : q{}; GetOptions( GetOptions( 'a|arrive=s' => sub { $arrival = 1; $time = $_[1] }, 'a|arrive=s' => sub { $arrival = 1; $time = $_[1] }, 'c|max-change=s' => \$max_change, 'c|max-change=s' => \$max_change, 'C|change-time=s' => \$min_change_time, 'd|date=s' => \$date, 'd|date=s' => \$date, 'h|help' => sub { show_help(0) }, 'h|help' => sub { show_help(0) }, 'f|full-route' => \$show_full_route, 'f|full-route' => \$show_full_route, Loading Loading @@ -85,16 +87,17 @@ if ( not( $from_stop and $to_stop ) ) { } } my %opt = ( my %opt = ( service => $service, service => $service, from_stop => $from_stop, from_stop => $from_stop, via_stops => \@via_stops, via_stops => \@via_stops, to_stop => $to_stop, to_stop => $to_stop, excluded_mots => \@excluded_mots, excluded_mots => \@excluded_mots, exclusive_mots => \@exclusive_mots, exclusive_mots => \@exclusive_mots, max_change => $max_change, max_change => $max_change, developer_mode => $developer_mode, min_change_time => $min_change_time, arrival => $arrival, developer_mode => $developer_mode, language => $language, arrival => $arrival, language => $language, ); ); if ( $date or $time ) { if ( $date or $time ) { Loading Loading @@ -477,6 +480,12 @@ Overrides B<--time> / B<--depart>. Request connections with no more than I<count> changeovers. Request connections with no more than I<count> changeovers. =item B<-C>, B<--change-time> I<minutes> Request connections with scheduled changeover durations of at least I<minutes>. Note that this does not account for real-time data: the backend may return delayed connections that violate the specified changeover duration. =item B<-d>, B<--date> I<dd>.I<mm>.[I<yyyy>] =item B<-d>, B<--date> I<dd>.I<mm>.[I<yyyy>] Planned departure (or arrival) date. Default: today. Planned departure (or arrival) date. Default: today. Loading lib/Travel/Routing/DE/HAFAS.pm +7 −1 Original line number Original line Diff line number Diff line Loading @@ -243,7 +243,7 @@ sub new { arrLocL => [ $self->stop_to_hafas( $self->{to_stop} ) ], arrLocL => [ $self->stop_to_hafas( $self->{to_stop} ) ], numF => 6, numF => 6, maxChg => $conf{max_change}, maxChg => $conf{max_change}, minChgTime => undef, minChgTime => $conf{min_change_time}, outFrwd => $outFrwd, outFrwd => $outFrwd, viaLocL => @via_locs viaLocL => @via_locs ? [ map { { loc => $_ } } @via_locs ] ? [ map { { loc => $_ } } @via_locs ] Loading Loading @@ -760,6 +760,12 @@ pass an empty hashref to call the LWP::UserAgent constructor without arguments. Request connections with no more than I<count> changeovers. Request connections with no more than I<count> changeovers. =item B<min_change_time> => I<minutes> Request connections with scheduled changeover durations of at least I<minutes>. Note that this does not account for real-time data: the backend may return delayed connections that violate the specified changeover duration. =item B<service> => I<service> =item B<service> => I<service> Request results from I<service>, defaults to "DB". Request results from I<service>, defaults to "DB". Loading Loading
Changelog +5 −0 Original line number Original line Diff line number Diff line git HEAD * hafas: Add -C / --change-time option * HAFAS: Add min_change_time option Travel::Routing::DE::HAFAS 0.05 - Sun Mar 24 2024 Travel::Routing::DE::HAFAS 0.05 - Sun Mar 24 2024 * hafas: Add -c / --max-change option * hafas: Add -c / --max-change option Loading
bin/hafas +21 −12 Original line number Original line Diff line number Diff line Loading @@ -22,8 +22,9 @@ my ( $json_output, $raw_json_output ); my $show_full_route; my $show_full_route; my ( $list_services, $service ); my ( $list_services, $service ); my ( @excluded_mots, @exclusive_mots ); my ( @excluded_mots, @exclusive_mots ); my $max_change = undef; my $max_change = undef; my $verbosity = 0; my $min_change_time = undef; my $verbosity = 0; my @output; my @output; my %min_verbosity = ( my %min_verbosity = ( Loading @@ -47,6 +48,7 @@ my $output_reset = -t STDOUT ? "\033[0m" : q{}; GetOptions( GetOptions( 'a|arrive=s' => sub { $arrival = 1; $time = $_[1] }, 'a|arrive=s' => sub { $arrival = 1; $time = $_[1] }, 'c|max-change=s' => \$max_change, 'c|max-change=s' => \$max_change, 'C|change-time=s' => \$min_change_time, 'd|date=s' => \$date, 'd|date=s' => \$date, 'h|help' => sub { show_help(0) }, 'h|help' => sub { show_help(0) }, 'f|full-route' => \$show_full_route, 'f|full-route' => \$show_full_route, Loading Loading @@ -85,16 +87,17 @@ if ( not( $from_stop and $to_stop ) ) { } } my %opt = ( my %opt = ( service => $service, service => $service, from_stop => $from_stop, from_stop => $from_stop, via_stops => \@via_stops, via_stops => \@via_stops, to_stop => $to_stop, to_stop => $to_stop, excluded_mots => \@excluded_mots, excluded_mots => \@excluded_mots, exclusive_mots => \@exclusive_mots, exclusive_mots => \@exclusive_mots, max_change => $max_change, max_change => $max_change, developer_mode => $developer_mode, min_change_time => $min_change_time, arrival => $arrival, developer_mode => $developer_mode, language => $language, arrival => $arrival, language => $language, ); ); if ( $date or $time ) { if ( $date or $time ) { Loading Loading @@ -477,6 +480,12 @@ Overrides B<--time> / B<--depart>. Request connections with no more than I<count> changeovers. Request connections with no more than I<count> changeovers. =item B<-C>, B<--change-time> I<minutes> Request connections with scheduled changeover durations of at least I<minutes>. Note that this does not account for real-time data: the backend may return delayed connections that violate the specified changeover duration. =item B<-d>, B<--date> I<dd>.I<mm>.[I<yyyy>] =item B<-d>, B<--date> I<dd>.I<mm>.[I<yyyy>] Planned departure (or arrival) date. Default: today. Planned departure (or arrival) date. Default: today. Loading
lib/Travel/Routing/DE/HAFAS.pm +7 −1 Original line number Original line Diff line number Diff line Loading @@ -243,7 +243,7 @@ sub new { arrLocL => [ $self->stop_to_hafas( $self->{to_stop} ) ], arrLocL => [ $self->stop_to_hafas( $self->{to_stop} ) ], numF => 6, numF => 6, maxChg => $conf{max_change}, maxChg => $conf{max_change}, minChgTime => undef, minChgTime => $conf{min_change_time}, outFrwd => $outFrwd, outFrwd => $outFrwd, viaLocL => @via_locs viaLocL => @via_locs ? [ map { { loc => $_ } } @via_locs ] ? [ map { { loc => $_ } } @via_locs ] Loading Loading @@ -760,6 +760,12 @@ pass an empty hashref to call the LWP::UserAgent constructor without arguments. Request connections with no more than I<count> changeovers. Request connections with no more than I<count> changeovers. =item B<min_change_time> => I<minutes> Request connections with scheduled changeover durations of at least I<minutes>. Note that this does not account for real-time data: the backend may return delayed connections that violate the specified changeover duration. =item B<service> => I<service> =item B<service> => I<service> Request results from I<service>, defaults to "DB". Request results from I<service>, defaults to "DB". Loading