summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2015-07-18 14:02:28 +0200
committerDaniel Friesel <derf@finalrewind.org>2015-07-18 14:02:28 +0200
commit303ece4c611fda31debf2f4211a91dc102913c0a (patch)
tree59d28c31e4c9a9de873fe12737b6afa508ac6b23
parentcd0f562c910d1f77f976a5280bccce23c978ba52 (diff)
add accessibility options to bin/efa
-rwxr-xr-xbin/efa27
1 files changed, 27 insertions, 0 deletions
diff --git a/bin/efa b/bin/efa
index 2617fc6..ffa7e2b 100755
--- a/bin/efa
+++ b/bin/efa
@@ -20,6 +20,7 @@ our $VERSION = '2.12';
my $ignore_info = 'Fahrradmitnahme|Einstiegshilfe';
my $efa;
my $efa_url = 'http://efa.vrr.de/vrr/XSLT_TRIP_REQUEST2';
+my %accessibility;
my ( @from, @to, @via, $from_type, $to_type, $via_type );
my $opt = {
'efa-url' => \$efa_url,
@@ -202,6 +203,7 @@ sub display_connection {
GetOptions(
$opt,
qw{
+ accessibility|x=s@
arrive|a=s
auto-url|discover-and-print|A
bike|b
@@ -233,6 +235,19 @@ GetOptions(
) or show_help(1);
#>>>
+@{ $opt->{accessibility} }
+ = split( qr{,}, join( q{,}, @{ $opt->{accessibility} } ) );
+
+for my $field ( @{ $opt->{accessibility} } ) {
+ given ($field) {
+ when ( [qw[s no-stairs]] ) { $opt->{without_solid_stairs} = 1 }
+ when ( [qw[e no-escalators]] ) { $opt->{without_escalators} = 1 }
+ 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 }
+ }
+}
+
if ( $opt->{list} ) {
printf( "%-40s %-14s %s\n\n", 'service', 'abbr. (-s)', 'url (-u)' );
for my $service ( Travel::Routing::DE::EFA::get_efa_urls() ) {
@@ -323,6 +338,12 @@ if ( $opt->{discover} or $opt->{'auto-url'} ) {
max_interchanges => $opt->{'max-change'},
num_results => $opt->{'num-connections'},
+ without_solid_stairs => $opt->{without_solid_stairs},
+ without_escalators => $opt->{without_escalators},
+ without_elevators => $opt->{without_elevators},
+ with_low_platform => $opt->{with_low_platform},
+ with_wheelchair => $opt->{with_wheelchair},
+
developer_mode => $opt->{devmode},
lwp_options => { timeout => $opt->{timeout} },
);
@@ -364,6 +385,12 @@ else {
max_interchanges => $opt->{'max-change'},
num_results => $opt->{'num-connections'},
+ without_solid_stairs => $opt->{without_solid_stairs},
+ without_escalators => $opt->{without_escalators},
+ without_elevators => $opt->{without_elevators},
+ with_low_platform => $opt->{with_low_platform},
+ with_wheelchair => $opt->{with_wheelchair},
+
developer_mode => $opt->{devmode},
lwp_options => { timeout => $opt->{timeout} },
);