Skip to content
Snippets Groups Projects
Commit 2a1d17f8 authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

Fix efa --ignore-info to allow the argument to be omitted

parent 3368c4f2
No related branches found
No related tags found
No related merge requests found
...@@ -36,7 +36,7 @@ GetOptions( ...@@ -36,7 +36,7 @@ GetOptions(
exclude|e=s@ exclude|e=s@
from=s@{2} from=s@{2}
help|h help|h
ignore-info|I=s ignore-info|I:s
max-change|m=i max-change|m=i
prefer|P=s prefer|P=s
proximity|p proximity|p
...@@ -76,20 +76,24 @@ for my $pair ( [ \@from, \$from_type ], [ \@via, \$via_type ], ...@@ -76,20 +76,24 @@ for my $pair ( [ \@from, \$from_type ], [ \@via, \$via_type ],
} }
} }
if ( defined $opt->{'ignore-info'} and length( $opt->{'ignore-info'} ) == 0 ) {
$opt->{'ignore-info'} = undef;
}
$efa = Net::Travel::DE::VRR->new( $efa = Net::Travel::DE::VRR->new(
origin => [ @from, $from_type ], origin => [ @from, $from_type ],
destination => [ @to, $to_type ], destination => [ @to, $to_type ],
via => ( @via ? [ @via, $via_type ] : undef ), via => ( @via ? [ @via, $via_type ] : undef ),
arrival_time => $opt->{'arrive'}, arrival_time => $opt->{arrive},
departure_time => $opt->{'depart'} // $opt->{'time'}, departure_time => $opt->{depart} // $opt->{time},
date => $opt->{'date'}, date => $opt->{date},
exclude => $opt->{'exclude'}, exclude => $opt->{exclude},
train_type => $opt->{'include'}, train_type => $opt->{include},
with_bike => $opt->{'bike'}, with_bike => $opt->{bike},
select_interchange_by => $opt->{'prefer'}, select_interchange_by => $opt->{prefer},
use_near_stops => $opt->{'proximity'}, use_near_stops => $opt->{proximity},
walk_speed => $opt->{'walk-speed'}, walk_speed => $opt->{'walk-speed'},
max_interchanges => $opt->{'max-change'}, max_interchanges => $opt->{'max-change'},
); );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment