Use long argument for checkpoint

This commit is contained in:
scribblemaniac 2021-11-05 17:27:14 -06:00
parent 2a4afad91a
commit c9396de8b2
No known key found for this signature in database
GPG key ID: 7C7B792A6AD57A97

16
main.c
View file

@ -112,7 +112,7 @@ static void printhelp(FILE *out,const char *progname)
#ifdef PASSPHRASE
"\t-p passphrase - use passphrase to initialize the random seed with\n"
"\t-P - same as -p, but takes passphrase from PASSPHRASE environment variable\n"
"\t-c filename - load/save checkpoint of progress to specified file (requires passphrase)\n"
"\t--checkpoint filename - load/save checkpoint of progress to specified file (requires passphrase)\n"
#endif
,progname,progname);
fflush(out);
@ -249,6 +249,14 @@ int main(int argc,char **argv)
}
else if (!strcmp(arg,"rawyaml"))
yamlraw = 1;
#ifdef PASSPHRASE
else if (!strcmp(arg,"checkpoint")) {
if (argc--)
checkpointfile = *argv++;
else
e_additional();
}
#endif // PASSPHRASE
else {
fprintf(stderr,"unrecognised argument: --%s\n",arg);
exit(1);
@ -394,12 +402,6 @@ int main(int argc,char **argv)
setpassphrase(pass);
deterministic = 1;
}
else if (*arg == 'c') {
if (argc--)
checkpointfile = *argv++;
else
e_additional();
}
#endif // PASSPHRASE
else {
fprintf(stderr,"unrecognised argument: -%c\n",*arg);