Basic CLI help and error checking for a valid stride
This commit is contained in:
@@ -10,6 +10,16 @@ my $perday = 1152;
|
|||||||
my $hush = "./src/hush-cli";
|
my $hush = "./src/hush-cli";
|
||||||
my $gethash = "$hush getblockhash";
|
my $gethash = "$hush getblockhash";
|
||||||
my $stride = shift || 1000;
|
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 $count = 0;
|
||||||
my $blocks = qx{$hush getblockcount};
|
my $blocks = qx{$hush getblockcount};
|
||||||
if($?) {
|
if($?) {
|
||||||
|
|||||||
Reference in New Issue
Block a user