-$opt_h = 1;
-$opt_d = 0;
-$opt_t = 1;
-$opt_l = 2;
-
-require 'getopts.pl';
-&Getopts('f:rahdD:l:s:');
-
-if ($opt_r) { $real = 1;}
-if ($opt_a) { $anon = 1;}
-if ($real == 0 && $anon == 0) { $anon = 1; }
-if ($opt_f) {$usage_file = $opt_f;}
-
-open (LOG,$usage_file) || die "Error opening usage log file: $usage_file\n";
-
-if ($opt_D) {print "Transfer Totals include the '$opt_D' domain only.\n";
- print "All other domains are filtered out for this report.\n\n";}
+$hourly_report = 0;
+$domain_report = 0;
+$total_report = 0;
+$depth_limit = 9999;
+$only_section = '';
+
+&Getopt::Long::Configure('bundling');
+&usage if !&GetOptions(
+ 'hourly-report|h' => \$hourly_report,
+ 'domain-report|d' => \$domain_report,
+ 'domain|D:s' => \$only_domain,
+ 'total-report|t' => \$total_report,
+ 'depth-limit|l:i' => \$depth_limit,
+ 'real|r' => \$real,
+ 'anon|a' => \$anon,
+ 'section|s:s' => \$only_section,
+ 'file|f:s' => \$usage_file,
+);
+
+$anon = 1 if !$real && !$anon;
+
+open(LOG, $usage_file) || die "Error opening usage log file: $usage_file\n";
+
+if ($only_domain) {
+ print "Transfer Totals include the '$only_domain' domain only.\n";
+ print "All other domains are filtered out for this report.\n\n";
+}