Unverified Commit 76e76af7 authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

hafas-m: use a consistent if/elsif chain for operating modes

parent bca6e281
Loading
Loading
Loading
Loading
+82 −84
Original line number Diff line number Diff line
@@ -412,13 +412,11 @@ if ( $opt{geoSearch} ) {
			$result->eva, $result->name
		);
	}
	exit 0;
}
elsif ( $opt{locationSearch} ) {
	for my $result ( $status->results ) {
		printf( "%8d  %s\n", $result->eva, $result->name );
	}
	exit 0;
}
elsif ( $opt{journey} ) {
	my $result = $status->result;
@@ -597,9 +595,8 @@ elsif ( $opt{journey} ) {
			printf( "(%d) %s\n", $msg->{id}, $msg->text );
		}
	}
	exit 0;
}

else {
	my @results = map { $_->[1] }
	  sort { $a->[0] <=> $b->[0] }
	  map { [ $_->datetime->epoch, $_ ] } $status->results;
@@ -698,6 +695,7 @@ for my $m ( $status->messages ) {
			}
		}
	}
}

__END__

@@ -777,8 +775,8 @@ Europe/Berlin). If a stop's local time differs, it is also provided.

=head1 OPTIONS

Values in brackets indicate options that only apply to the indicated operating
mode(s).
Values in brackets indicate options that only apply to the corresponding
operating mode(s).

=over