summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2011-05-31 11:33:44 +0200
committerDaniel Friesel <derf@finalrewind.org>2011-05-31 11:33:44 +0200
commit2a1d17f8d50aacd9de082139e76c55ee40199a15 (patch)
tree18c02fe5f4bb366ad213bd7817c03c8dd2ea25ae /bin
parent3368c4f2a06c73b2e042efd52dfdab4b31f2ea5c (diff)
Fix efa --ignore-info to allow the argument to be omitted
Diffstat (limited to 'bin')
-rwxr-xr-xbin/efa22
1 files changed, 13 insertions, 9 deletions
diff --git a/bin/efa b/bin/efa
index d654c7f..03be6b9 100755
--- a/bin/efa
+++ b/bin/efa
@@ -36,7 +36,7 @@ GetOptions(
exclude|e=s@
from=s@{2}
help|h
- ignore-info|I=s
+ ignore-info|I:s
max-change|m=i
prefer|P=s
proximity|p
@@ -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(
origin => [ @from, $from_type ],
destination => [ @to, $to_type ],
via => ( @via ? [ @via, $via_type ] : undef ),
- arrival_time => $opt->{'arrive'},
- departure_time => $opt->{'depart'} // $opt->{'time'},
- date => $opt->{'date'},
- exclude => $opt->{'exclude'},
- train_type => $opt->{'include'},
- with_bike => $opt->{'bike'},
+ arrival_time => $opt->{arrive},
+ departure_time => $opt->{depart} // $opt->{time},
+ date => $opt->{date},
+ exclude => $opt->{exclude},
+ train_type => $opt->{include},
+ with_bike => $opt->{bike},
- select_interchange_by => $opt->{'prefer'},
- use_near_stops => $opt->{'proximity'},
+ select_interchange_by => $opt->{prefer},
+ use_near_stops => $opt->{proximity},
walk_speed => $opt->{'walk-speed'},
max_interchanges => $opt->{'max-change'},
);