Basic CLI help and error checking for a valid stride

This commit is contained in:
Duke Leto
2022-09-19 13:12:37 -04:00
parent 473ec30404
commit 0fb9db169c

View File

@@ -10,6 +10,16 @@ my $perday = 1152;
my $hush = "./src/hush-cli";
my $gethash = "$hush getblockhash";
my $stride = shift || 1000;
if ($stride =~ m/help/) {
print "To generate checkpoint data every 1000 blocks: $0 &> checkpoints.txt\n";
print "To generate checkpoint data every X blocks: $0 X &> checkpoints.txt\n";
exit 0;
}
unless ($stride == int($stride) and $stride >= 0) {
print "Invalid stride! Must be an integer > 0\n";
exit 1;
}
my $count = 0;
my $blocks = qx{$hush getblockcount};
if($?) {