override version option to only show main program v1.06
authorMischa POSLAWSKY <perl@shiar.org>
Sat, 14 Sep 2019 18:39:14 +0000 (20:39 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Tue, 24 Sep 2019 00:08:51 +0000 (02:08 +0200)
Default Getopt::Long results include environment-specific details unlike
most other programs, maybe enforcing minimal details in some bug reports,
but making test output non-portable.

barcat
t/t0001-version_--version.out

diff --git a/barcat b/barcat
index 1bcda801779e9a4028b07f5005b5217b5d5120e8..db0aefa23fb370051399b502954972f388f39281 100755 (executable)
--- a/barcat
+++ b/barcat
@@ -6,7 +6,7 @@ use List::Util qw( min max sum );
 use open qw( :std :utf8 );
 use experimental qw( lexical_subs );
 
-our $VERSION = '1.05';
+our $VERSION = '1.06';
 
 use Getopt::Long '2.33', qw( :config gnu_getopt );
 my %opt;
@@ -53,6 +53,10 @@ GetOptions(\%opt,
        'signal-stat=s',
        'unmodified|u!',
        'width|w=i',
+       'version' => sub {
+               say "barcat version $VERSION";
+               exit;
+       },
        'usage|h' => sub {
                local $/;
                my $pod = readline *DATA;
index 8f670b5b9f7ea5451f9c47bf87a9154cf5d7fb33..e177fbbd2619282f280eb1825c49c4264a458f85 100644 (file)
@@ -1,2 +1 @@
-./barcat version 1.05
-(Getopt::Long::GetOptions version 2.48; Perl version 5.24.1)
+barcat version 1.06