summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2015-06-22 23:48:10 +0200
committerDaniel Friesel <derf@finalrewind.org>2015-06-22 23:48:10 +0200
commit5fc7f99bf99c5a90cc201abf0b91671c89b7d4d3 (patch)
tree97c3fd754ab4143b95b6502199f7d44761c8cbe2 /bin
parent19e4975742b1a879d5c6e05ee4cb8cce9b981e61 (diff)
bin/efa: warn when -a and -t are used at the same time
Diffstat (limited to 'bin')
-rwxr-xr-xbin/efa14
1 files changed, 10 insertions, 4 deletions
diff --git a/bin/efa b/bin/efa
index 3f0822c..a5b5403 100755
--- a/bin/efa
+++ b/bin/efa
@@ -205,7 +205,7 @@ GetOptions(
auto-url|discover-and-print|A
bike|b
date|d=s
- depart=s
+ depart|time|t=s
devmode
discover|D
efa-url|u=s
@@ -223,7 +223,6 @@ GetOptions(
prefer|P=s
proximity|p:10
service|s=s
- time|t=s
timeout=i
to=s@{2}
version|v
@@ -241,6 +240,13 @@ if ( $opt->{list} ) {
exit 0;
}
+if ( $opt->{arrive} and $opt->{depart} ) {
+ print STDERR 'Note: The options -a/--arrive and -t/--time/--depart are'
+ . " mutually exclusive\n"
+ . " Discarding the --arrive option\n\n";
+ delete $opt->{arrive};
+}
+
if ( not( @from and @to ) ) {
if ( @ARGV == 4 ) {
( @from[ 0, 1 ], @to[ 0, 1 ] ) = @ARGV;
@@ -304,7 +310,7 @@ if ( $opt->{discover} or $opt->{'auto-url'} ) {
via => ( @via ? [ @via, $via_type ] : undef ),
arrival_time => $opt->{arrive},
- departure_time => $opt->{depart} // $opt->{time},
+ departure_time => $opt->{depart},
date => $opt->{date},
exclude => $opt->{exclude},
train_type => $opt->{include},
@@ -345,7 +351,7 @@ else {
via => ( @via ? [ @via, $via_type ] : undef ),
arrival_time => $opt->{arrive},
- departure_time => $opt->{depart} // $opt->{time},
+ departure_time => $opt->{depart},
date => $opt->{date},
exclude => $opt->{exclude},
train_type => $opt->{include},