summaryrefslogtreecommitdiff
path: root/bin/hafas-m
diff options
context:
space:
mode:
Diffstat (limited to 'bin/hafas-m')
-rwxr-xr-xbin/hafas-m10
1 files changed, 10 insertions, 0 deletions
diff --git a/bin/hafas-m b/bin/hafas-m
index 2e48a90..e53a910 100755
--- a/bin/hafas-m
+++ b/bin/hafas-m
@@ -66,6 +66,10 @@ if ( $opt{station} =~ m{ ^ (?<lat> [0-9.]+ ) : (?<lon> [0-9].+ ) $ }x ) {
};
delete $opt{station};
}
+elsif ( $opt{station} =~ m{ ^ [?] (?<query> .*) $ }x ) {
+ $opt{locationSearch} = $+{query};
+ delete $opt{station};
+}
elsif ( $opt{station} =~ m{[|]} ) {
$opt{journey} = { id => $opt{station} };
delete $opt{station};
@@ -251,6 +255,12 @@ if ( $opt{geoSearch} ) {
}
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;