From e63ef6008dec5a15ffea95e679ef21b856c8e88b Mon Sep 17 00:00:00 2001 From: Dr-Noob Date: Sat, 21 Aug 2021 10:48:06 +0200 Subject: [PATCH] [v0.99] Always print warning messages in parse_args function --- src/common/args.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/common/args.c b/src/common/args.c index 22bc48b..616cd39 100644 --- a/src/common/args.c +++ b/src/common/args.c @@ -246,6 +246,9 @@ bool parse_args(int argc, char* argv[]) { args.style = STYLE_EMPTY; args.colors = NULL; + // Temporary enable verbose level to allow printing warnings inside parse_args + set_log_level(true); + const struct option long_options[] = { {args_str[ARG_STYLE], required_argument, 0, args_chr[ARG_STYLE] }, {args_str[ARG_COLOR], required_argument, 0, args_chr[ARG_COLOR] }, @@ -334,11 +337,6 @@ bool parse_args(int argc, char* argv[]) { args.help_flag = true; } - if((args.help_flag + args.version_flag + color_flag) > 1) { - printWarn("You should specify just one option"); - args.help_flag = true; - } - if(args.logo_intel_new && args.logo_intel_old) { printWarn("%s and %s cannot be specified together", args_str[ARG_LOGO_INTEL_NEW], args_str[ARG_LOGO_INTEL_OLD]); args.logo_intel_new = false; @@ -351,5 +349,8 @@ bool parse_args(int argc, char* argv[]) { args.logo_long = false; } + // Leave log level untouched after returning + set_log_level(false); + return true; }