summaryrefslogtreecommitdiff
path: root/bin/hafas-m
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2024-02-24 11:12:35 +0100
committerBirte Kristina Friesel <derf@finalrewind.org>2024-02-24 11:12:35 +0100
commitcca75a4228622e45d831381359f6e32e46ad11a3 (patch)
treec628f247b130f5549b1b5039009a9c34996d0aa8 /bin/hafas-m
parentf9b37e25ae5cc118275ecd0b6c65aa5bc97a0803 (diff)
HAFAS, hafas-m: Add descriptions for ÖBB MOT bits
See #11
Diffstat (limited to 'bin/hafas-m')
-rwxr-xr-xbin/hafas-m13
1 files changed, 8 insertions, 5 deletions
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 {