Commits

shl...@52c325ad-5fd0-0310-8a0f-c43feede02cc  committed 2acf512

Added Pod::Usage support.

  • Participants
  • Parent commits 3251ec1

Comments (0)

Files changed (1)

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

 use warnings;
 
 use Getopt::Long;
+use Pod::Usage;
 
 my $prefix = "";
 my $depth = 1;
 my $sort = 1;
+my $man = 0;
+my $help = 0;
 
 GetOptions(
     "prefix|p=s" => \$prefix,
     "depth|d=n" => \$depth,
     "sort" => \$sort,
-);
+    "help|h" => \$help, 
+    "man" => \$man,
+) or pod2usage(2);
+
+if ($help)
+{
+    pod2usage(1)
+}
+
+if ($man)
+{
+    pod2usage(-verbose => 2);
+}
+
 my @results=();
 while(my $line = <>)
 {