nethack --version:dump
Add the 'dump' argument to the existing '--version' command-line option to display the magic numbers used when validating save and bones files for compatibility. Nothing exciting, just a line of 5 hex values. I was going to also list the values for however many save and bones files are specified on the command line but it seems to need more effort than I care to expend. And I hadn't made up my mind whether that should be done by nethack, recover, or some new standalone program. [Single line of relatively raw output is so that they could be compared more easily.] nethack --version:bad-argument was writing a message to stdout and then starting play--which immediately overwrites stdout. Have it quit instead. Player wasn't trying to start a game and quitting is what it does with --version:good-argument.
This commit is contained in:
@@ -936,7 +936,7 @@ argcheck(int argc, char *argv[], enum earlyarg e_arg)
|
||||
break;
|
||||
}
|
||||
if (idx >= SIZE(earlyopts) || argc < 1)
|
||||
return FALSE;
|
||||
return 0;
|
||||
|
||||
for (i = 0; i < argc; ++i) {
|
||||
if (argv[i][0] != '-')
|
||||
@@ -975,13 +975,21 @@ argcheck(int argc, char *argv[], enum earlyarg e_arg)
|
||||
than next major version */
|
||||
if (match_optname(extended_opt, "paste", 5, FALSE)) {
|
||||
insert_into_pastebuf = TRUE;
|
||||
} else if(match_optname(extended_opt, "copy", 4, FALSE)) {
|
||||
} else if (match_optname(extended_opt, "copy", 4, FALSE)) {
|
||||
insert_into_pastebuf = TRUE;
|
||||
} else {
|
||||
raw_printf(
|
||||
"-%sversion can only be extended with -%sversion:copy.\n",
|
||||
} else if (match_optname(extended_opt, "dump", 4, FALSE)) {
|
||||
/* version number plus enabled features and sanity
|
||||
values that the program compares against the same
|
||||
thing recorded in save and bones files to check
|
||||
whether they're being used compatibly */
|
||||
dump_version_info();
|
||||
return 2; /* done */
|
||||
} else if (!match_optname(extended_opt, "show", 4, FALSE)) {
|
||||
raw_printf("-%sversion can only be extended with"
|
||||
" -%sversion:copy or :dump or :show.\n",
|
||||
dashdash, dashdash);
|
||||
return TRUE;
|
||||
/* exit after we've reported bad command line argument */
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
early_version_info(insert_into_pastebuf);
|
||||
@@ -1016,7 +1024,7 @@ argcheck(int argc, char *argv[], enum earlyarg e_arg)
|
||||
break;
|
||||
}
|
||||
};
|
||||
return FALSE;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user