From af5d5ac3680d0297c62f7091620a721ab2389b2a Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Sun, 7 Aug 2022 07:12:01 -0700 Subject: main: still show configured flags with --go Show the info, but skip the wait step. --- src/main.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/main.c b/src/main.c index 2f945b1..d1399c3 100644 --- a/src/main.c +++ b/src/main.c @@ -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))), -- cgit v1.2.3