From cca75a4228622e45d831381359f6e32e46ad11a3 Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Sat, 24 Feb 2024 11:12:35 +0100 Subject: HAFAS, hafas-m: Add descriptions for ÖBB MOT bits MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See #11 --- bin/hafas-m | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'bin/hafas-m') diff --git a/bin/hafas-m b/bin/hafas-m index 5b839d6..67321d1 100755 --- a/bin/hafas-m +++ b/bin/hafas-m @@ -157,11 +157,14 @@ sub parse_mot_options { $service //= 'DB'; my $desc = Travel::Status::DE::HAFAS::get_service($service); if ($desc) { - my @mots = @{ $desc->{productbits} }; - @mots = grep { $_ ne 'x' } @mots; - @mots = uniq @mots; - @mots = sort @mots; - say join( "\n", @mots ); + for my $mot ( @{ $desc->{productbits} } ) { + if ( ref($mot) eq 'ARRAY' ) { + printf( "%-10s %s\n", @{$mot} ); + } + else { + say $mot; + } + } exit 0; } else { -- cgit v1.2.3