summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2011-06-29 00:20:09 +0200
committerDaniel Friesel <derf@finalrewind.org>2011-06-29 00:20:09 +0200
commit5551da62c1791549251c09b02a5d02d9bf0a589e (patch)
tree8895ae1d3be694a33f9bc3c3f2a62b0035f992a3
parentfa8720d6bdc7794deec076cca2ee22da7ad8ab7c (diff)
efa: Add little help text, do not launch perldoc on --help
-rwxr-xr-xbin/efa13
1 files changed, 10 insertions, 3 deletions
diff --git a/bin/efa b/bin/efa
index c916ca0..acd0550 100755
--- a/bin/efa
+++ b/bin/efa
@@ -15,17 +15,24 @@ my $ignore_info = 'Fahrradmitnahme';
my $efa;
my ( @from, @to, @via, $from_type, $to_type, $via_type );
my $opt = {
- 'help' => sub { exec( 'perldoc', '-F', $0 ) },
+ 'help' => \&show_help,
+ ,
'ignore-info' => \$ignore_info,
'from' => \@from,
'to' => \@to,
- 'version' => sub { say "efa version $VERSION"; exit 0 },
- 'via' => \@via,
+ 'version' => sub { say "efa version $VERSION"; exit 0 },
+ 'via' => \@via,
};
binmode( STDOUT, ':encoding(utf-8)' );
binmode( STDERR, ':encoding(utf-8)' );
+sub show_help {
+ say 'Usage: efa [options] <from-city> <from-stop> <to-city> <to-stop>';
+ say 'See also: man efa';
+ exit 0;
+}
+
sub handle_efa_exception {
my ($e) = @_;