summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2022-08-07 07:12:01 -0700
committerVito Caputo <vcaputo@pengaru.com>2022-08-07 07:12:01 -0700
commitaf5d5ac3680d0297c62f7091620a721ab2389b2a (patch)
treec3cbbd4e67bb8acd0c0971fcb197ceeca5d8da34 /src
parentabd93adab83bc2573b052f0c1181c3e638e88537 (diff)
main: still show configured flags with --go
Show the info, but skip the wait step.
Diffstat (limited to 'src')
-rw-r--r--src/main.c15
1 files changed, 10 insertions, 5 deletions
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))),
© All Rights Reserved