...
 
Commits (2)
......@@ -19,17 +19,15 @@ GetOptions(
'debug',
);
pod2usage() if ($opt->{'help'});
pod2usage({'-verbose' => 99, '-sections' => 'USAGE|OPTIONS'}) unless ($ARGV[0]);
$opt->{'type'} ||= 'domain';
pod2usage({'-verbose' => 99, '-sections' => 'USAGE|OPTIONS'}) unless ($opt->{'type'} =~ /^(domain|entity|nameserver|help)$/);
$opt->{'type'} ||= 'domain';
$opt->{'handle'} ||= basename($ARGV[0]);
pod2usage() if ($opt->{'help'});
pod2usage({'-verbose' => 99, '-sections' => 'USAGE|OPTIONS'}) unless ($ARGV[0] || $opt->{'type'} =~ /^(domain|entity|nameserver|help)$/);
$ENV{'NET_RDAP_UA_DEBUG'} = $opt->{'debug'};
printf(STDERR "Testing %s which is a domain...\n", $ARGV[0], $opt->{'type'});
printf(STDERR "Testing %s, type '%s'...\n", $ARGV[0], $opt->{'type'});
my $response = Net::RDAP->new->fetch(URI->new($ARGV[0]));
......@@ -98,6 +96,7 @@ sub check_rdap_conformance {
}
}
}
sub check_gtld_conformance {
my $response = shift;
......@@ -138,7 +137,11 @@ sub fail {
$error = mkerror($error, @_) if (!$error->isa('Net::RDAP::Error'));
printf(STDERR "FAIL (#%04d): %s\n\n", $error->errorCode, $error->title);
my @description = $error->description;
print "Description:\n\n".fill(" ", " ", join("\n", @description))."\n\n" if (scalar(@description) > 0);
if (scalar(@description) > 0) {
print "Description:\n\n".
fill(" ", " ", join("\n", @description)).
"\n\n";
}
}
sub mkerror {
......