Commit 5551da62 authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

efa: Add little help text, do not launch perldoc on --help

parent fa8720d6
Loading
Loading
Loading
Loading
+10 −3
Original line number Diff line number Diff line
@@ -15,7 +15,8 @@ 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,
@@ -26,6 +27,12 @@ my $opt = {
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) = @_;