CLI: add --skip-to-bookmark/-b flag

This simply sets the TAISEI_SKIP_TO_BOOKMARK env variable
This commit is contained in:
Andrei Alexeyev 2021-05-06 21:13:29 +03:00
parent d126eba2d2
commit 8ff5890abe
No known key found for this signature in database
GPG key ID: 72D26128040B9690

View file

@ -85,6 +85,7 @@ int cli_args(int argc, char **argv, CLIAction *a) {
{{"cutscene", required_argument, 0, OPT_CUTSCENE}, "Play cutscene by numeric %s and exit", "ID"},
{{"list-cutscenes", no_argument, 0, OPT_CUTSCENE_LIST}, "List all registered cutscenes with their numeric IDs and names, then exit" },
{{"intro", no_argument, 0, OPT_FORCE_INTRO}, "Play the intro cutscene even if already seen"},
{{"skip-to-bookmark", required_argument, 0, 'b'}, "Fast-forward stage to a specific STAGE_BOOKMARK call"},
#endif
{{"frameskip", optional_argument, 0, 'f'}, "Disable FPS limiter, render only every %s frame", "FRAME"},
{{"credits", no_argument, 0, 'c'}, "Show the credits scene and exit"},
@ -224,6 +225,9 @@ int cli_args(int argc, char **argv, CLIAction *a) {
case OPT_FORCE_INTRO:
a->force_intro = true;
break;
case 'b':
env_set("TAISEI_SKIP_TO_BOOKMARK", optarg, true);
break;
case 'v':
tsfprintf(stdout, "%s %s\n", TAISEI_VERSION_FULL, TAISEI_VERSION_BUILD_TYPE);
exit(0);