From 7b80fa622f9499cf4988fee23b3c65c63f489c20 Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Tue, 24 Dec 2024 13:40:01 +0100 Subject: efa-m: add --raw-json --- bin/efa-m | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'bin/efa-m') 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 (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 -- cgit v1.2.3