summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2024-12-24 13:40:01 +0100
committerBirte Kristina Friesel <derf@finalrewind.org>2024-12-24 13:40:36 +0100
commit7b80fa622f9499cf4988fee23b3c65c63f489c20 (patch)
tree4fa311926dbb7fe84e09c4c56b814a3c89e4abc1
parente6f66424fac95f997cda6bafa591f1d46c2bf52d (diff)
efa-m: add --raw-json
-rwxr-xr-xbin/efa-m11
1 files changed, 10 insertions, 1 deletions
diff --git a/bin/efa-m b/bin/efa-m
index 2b0e49d..ff609dc 100755
--- a/bin/efa-m
+++ b/bin/efa-m
@@ -19,7 +19,7 @@ my $efa_url;
my $efa_encoding;
my $use_cache = 1;
my $cache;
-my $json_output;
+my ( $json_output, $raw_json_output );
my ( $date, $time, $input_type, $list_lines, $offset, $relative_times );
my ( $full_routes, $filter_via, $show_jid );
my ( $timeout, $developer_mode );
@@ -60,6 +60,7 @@ GetOptions(
'V|track-via=s' => \$filter_via,
'cache!' => \$use_cache,
'json' => \$json_output,
+ 'raw-json' => \$raw_json_output,
'devmode' => \$developer_mode,
'version' => \&show_version,
@@ -575,6 +576,9 @@ if ($json_output) {
say JSON->new->convert_blessed->encode( [ $efa->results ] );
}
}
+elsif ($raw_json_output) {
+ say JSON->new->convert_blessed->encode( $efa->{response} );
+}
elsif ($coord) {
show_coord();
}
@@ -778,6 +782,11 @@ availability, delay reasons, and more.
Only show departures at I<platforms> (comma-separated list, option may be
repeated). Note that the C<< Bstg. >> / C<< Gleis >> prefix must be omitted.
+=item B<--raw-json>
+
+Print unprocessed EFA response as JSON and exit.
+Useful for debugging and development purposes.
+
=item B<-r>, B<--relative> (monitor)
Show relative departure times in minutes (i.e. the time difference between