inline podexit code for --help, alias to -?
authorMischa POSLAWSKY <perl@shiar.org>
Tue, 10 Sep 2019 01:48:47 +0000 (03:48 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Thu, 12 Sep 2019 15:48:11 +0000 (17:48 +0200)
barcat

diff --git a/barcat b/barcat
index a443942c5664b2ac1facae0379beab2ef83063e1..bac7ebd4d11adc5893b49d9a5e584c403080b76b 100755 (executable)
--- 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;