summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2015-09-18 01:20:30 +0200
committerDaniel Friesel <derf@finalrewind.org>2015-09-18 01:20:30 +0200
commitb0a9181998ac10c950e3a1605c719cbb89545bd7 (patch)
tree49f7f6b8951ea8e7a2920e6799b561bb366fa07f /bin
parent8b8dfe564faabc7d3ede40b529fcae8fecb3b0dd (diff)
hafas-m: fix -m help
Diffstat (limited to 'bin')
-rwxr-xr-xbin/hafas-m9
1 files changed, 6 insertions, 3 deletions
diff --git a/bin/hafas-m b/bin/hafas-m
index 931326a..97ecaa2 100755
--- a/bin/hafas-m
+++ b/bin/hafas-m
@@ -89,9 +89,12 @@ sub parse_mot_options {
for my $type ( split( qr{,}, $types ) ) {
if ( $type eq 'help' or $type eq 'list' or $type eq '?' ) {
- my $desc = Travel::Status::DE::HAFAS::get_service($service);
- if ($desc) {
- my @mots = @{ $desc->{productbits} };
+ if ( not $hafas_url ) {
+ $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;