diff options
author | Vito Caputo <vcaputo@pengaru.com> | 2022-08-07 07:12:01 -0700 |
---|---|---|
committer | Vito Caputo <vcaputo@pengaru.com> | 2022-08-07 07:12:01 -0700 |
commit | af5d5ac3680d0297c62f7091620a721ab2389b2a (patch) | |
tree | c3cbbd4e67bb8acd0c0971fcb197ceeca5d8da34 | |
parent | abd93adab83bc2573b052f0c1181c3e638e88537 (diff) |
main: still show configured flags with --go
Show the info, but skip the wait step.
-rw-r--r-- | src/main.c | 15 |
1 files changed, 10 insertions, 5 deletions
@@ -258,7 +258,7 @@ static char * seed_as_arg(unsigned seed) } -static int print_setup_as_args(setup_t *setup) +static int print_setup_as_args(setup_t *setup, int wait) { char *seed_arg, *module_args, *video_args; char buf[64]; @@ -276,15 +276,20 @@ static int print_setup_as_args(setup_t *setup) if (!video_args) goto _out_module; - r = printf("\nConfigured settings as flags:\n --seed=%s --module=%s --video=%s\n\nPress enter to continue, add --go to disable this notice...\n", + r = printf("\nConfigured settings as flags:\n --seed=%s --module=%s --video=%s\n", seed_arg, module_args, video_args); - if (r < 0) goto _out_video; - (void) fgets(buf, sizeof(buf), stdin); + if (wait) { + r = printf("\nPress enter to continue, add --go to skip this step...\n"); + if (r < 0) + goto _out_video; + + (void) fgets(buf, sizeof(buf), stdin); + } _out_video: free(video_args); @@ -362,7 +367,7 @@ int main(int argc, const char *argv[]) failed_desc ? "\"" : "", strerror(-r)); - exit_if(!args.gogogo && r && print_setup_as_args(&setup) < 0, + exit_if(r && print_setup_as_args(&setup, !args.gogogo) < 0, "unable to print setup"); exit_if(!(rototiller.module = til_lookup_module(til_settings_get_key(setup.module_settings, 0, NULL))), |