Commits

Anonymous committed e257c4c

Added the version and the --version flag

  • Participants
  • Parent commits 58ef3cd

Comments (0)

Files changed (1)

File du-output-analyser/analyse-du.pl

 use Getopt::Long;
 use Pod::Usage;
 
+our $VERSION = "0.2.0";
+
 my $prefix = "";
 my $depth = 1;
 my $sort = 1;
 my $man = 0;
 my $help = 0;
+my $version = 0;
 
 GetOptions(
     "prefix|p=s" => \$prefix,
     "sort" => \$sort,
     "help|h" => \$help, 
     "man" => \$man,
+    "version" => \$version,
 ) or pod2usage(2);
 
 if ($help)
     pod2usage(-verbose => 2);
 }
 
+if ($version)
+{
+    print "analyse-du.pl version $VERSION\n";
+    exit(0);
+}
+
 my @results=();
 while(my $line = <>)
 {
 
 B<analyse-du.pl> --prefix=progs/ --depth=1 --sort
 
+=head1 VERSION
+
+0.2.0
+
 =head1 DESCRIPTION
 
 This analyses the output of C<\du .> looking for directories with a certain