From 3b712427964d187605ea114d15852cb1c0978648 Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Wed, 8 Jan 2025 18:29:21 +0100 Subject: Drop default service; warn and fall back to ÖBB in hafas-m MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/hafas-m | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/hafas-m b/bin/hafas-m index 40f125b..a6899b0 100755 --- a/bin/hafas-m +++ b/bin/hafas-m @@ -64,7 +64,8 @@ if ($list_services) { 'time zone' ); for my $service ( Travel::Status::DE::HAFAS::get_services() ) { - if ($service->{shortname} eq 'DB') { + if ( $service->{shortname} eq 'DB' ) { + # HTTP 503 Service Unavailable next; } @@ -78,6 +79,18 @@ if ($list_services) { exit 0; } +if ( not $service ) { + say STDERR 'Note: You have called hafas-m without specifying a service.'; + say STDERR q{}; + say STDERR 'Unfortunately, the previous default service (DB HAFAS)'; + say STDERR 'is no more, and there is no generic replacement available.'; + say STDERR q{}; + say STDERR 'Please use "hafas-m --list" to list supported services,'; + say STDERR 'and then select one via -s .'; + say STDERR 'Falling back to ÖBB for now.'; + $service = 'ÖBB'; +} + if ($use_cache) { my $cache_path = ( $ENV{XDG_CACHE_HOME} // "$ENV{HOME}/.cache" ) . '/Travel-Status-DE-HAFAS'; -- cgit v1.2.3