summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2015-05-28 15:49:11 +0200
committerDaniel Friesel <derf@finalrewind.org>2015-05-28 15:49:11 +0200
commit7f49411f87ec0533a261ce875967f7f9a22b8777 (patch)
treebe8b17e31593afc57903508a83e69727ccd579d0
parent843388f82ba323965e1bff926d785a60d45f5590 (diff)
add --devmode option
-rwxr-xr-xbin/efa-m18
-rw-r--r--lib/Travel/Status/DE/EFA.pm5
2 files changed, 14 insertions, 9 deletions
diff --git a/bin/efa-m b/bin/efa-m
index 0dccb8c..0b1544d 100755
--- a/bin/efa-m
+++ b/bin/efa-m
@@ -16,7 +16,7 @@ use Travel::Status::DE::EFA;
my $efa_url = 'http://efa.vrr.de/vrr/XSLT_DM_REQUEST';
my ( $date, $time, $input_type, $list_lines, $offset, $relative_times );
-my ($timeout);
+my ( $timeout, $developer_mode );
my ( @grep_lines, @grep_platforms );
@ARGV = map { decode( 'UTF-8', $_ ) } @ARGV;
@@ -33,6 +33,7 @@ GetOptions(
'timeout=i' => \$timeout,
'u|efa-url=s' => \$efa_url,
'V|version' => \&show_version,
+ 'devmode' => \$developer_mode,
) or show_help(1);
@@ -51,13 +52,14 @@ if ( $input =~ s{ ^ (?<type> address|poi|stop) : }{}x ) {
}
my $status = Travel::Status::DE::EFA->new(
- date => $date,
- efa_url => $efa_url,
- place => $place,
- name => $input,
- time => $time,
- type => $input_type,
- timeout => $timeout,
+ date => $date,
+ developer_mode => $developer_mode,
+ efa_url => $efa_url,
+ place => $place,
+ name => $input,
+ time => $time,
+ type => $input_type,
+ timeout => $timeout,
);
sub show_help {
diff --git a/lib/Travel/Status/DE/EFA.pm b/lib/Travel/Status/DE/EFA.pm
index 4789ccc..0143cb6 100644
--- a/lib/Travel/Status/DE/EFA.pm
+++ b/lib/Travel/Status/DE/EFA.pm
@@ -104,6 +104,7 @@ sub new {
useProxFootSearch => '0',
useRealtime => '1',
},
+ developer_mode => $opt{developer_mode},
};
bless( $self, $class );
@@ -123,7 +124,9 @@ sub new {
string => $self->{xml},
);
- #say $self->{tree}->toString(1);
+ if ( $self->{developer_mode} ) {
+ say $self->{tree}->toString(1);
+ }
$self->check_for_ambiguous();