Commit 0f1d8e73 authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

efa: Improve ignore_info defaults based on accessibility and bike options

parent 9361286f
Loading
Loading
Loading
Loading
+13 −2
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@ use Getopt::Long qw/:config no_ignore_case/;
use List::Util qw(first);

our $VERSION = '2.12';
my $ignore_info = 'Fahrradmitnahme|Einstiegshilfe';
my $ignore_info;
my $efa;
my $efa_url = 'http://efa.vrr.de/vrr/XSLT_TRIP_REQUEST2';
my %accessibility;
@@ -247,6 +247,7 @@ for my $field ( @{ $opt->{accessibility} } ) {
		when ( [qw[E no-elevators]] )    { $opt->{without_elevators}    = 1 }
		when ( [qw[l nf low-platform]] ) { $opt->{with_low_platform}    = 1 }
		when ( [qw[w wheelchair]] )      { $opt->{with_wheelchair}      = 1 }
		when ( [qw[i info]] ) { }    # used for ignore_info default
	}
}

@@ -277,6 +278,16 @@ if ( not( @from and @to ) ) {
	}
}

if ( not defined $ignore_info ) {
	$ignore_info = join(
		q{|},
		grep { defined } (
			@{$opt->{accessibility}} ? undef : 'Einstiegshilfe',
			$opt->{bike}          ? undef : 'Fahrradmitnahme',
		)
	);
}

for my $pair ( [ \@from, \$from_type ], [ \@via, \$via_type ],
	[ \@to, \$to_type ], )
{