From: Mischa POSLAWSKY Date: Tue, 10 Sep 2019 01:48:47 +0000 (+0200) Subject: inline podexit code for --help, alias to -? X-Git-Url: http://git.shiar.nl/barcat.git/commitdiff_plain/337fc37b729448f7789fcd13d4bd26de6223ddbc?hp=24559734dc4c9e6328c42fc5c33c79dde1f0e298 inline podexit code for --help, alias to -? --- diff --git a/barcat b/barcat index a443942..bac7ebd 100755 --- a/barcat +++ b/barcat @@ -9,10 +9,6 @@ use experimental qw( lexical_subs ); our $VERSION = '1.05'; use Getopt::Long '2.33', qw( :config gnu_getopt ); -sub podexit { - require Pod::Usage; - Pod::Usage::pod2usage(-exitval => 0, -perldocopt => '-oman', @_); -} my %opt; GetOptions(\%opt, 'color|c!', @@ -69,7 +65,12 @@ GetOptions(\%opt, print $contents; exit; }, - 'help' => sub { podexit(-verbose => 2) }, + 'help|?' => sub { + require Pod::Usage; + Pod::Usage::pod2usage( + -exitval => 0, -perldocopt => '-oman', -verbose => 2, + ); + }, ) or exit 64; # EX_USAGE $opt{width} ||= $ENV{COLUMNS} || 80;