diff --git a/src/main.c b/src/main.c index 5a6fefe..1c42bde 100644 --- a/src/main.c +++ b/src/main.c @@ -139,11 +139,17 @@ print_error_message(char** argv, { puts("[Error] Incorrect CLI argument input."); - if (error_code & 0x1) - print_argument_error(argv, argc, 1); + int current_argument_position = 1; + int temp_error_code = error_code; - if (error_code & 0x2) - print_argument_error(argv, argc, 2); + while (temp_error_code) + { + if (temp_error_code & 0x1) + print_argument_error(argv, argc, current_argument_position); + + temp_error_code >>= 1; + current_argument_position++; + } } int @@ -176,5 +182,3 @@ main(int argc, return 0; } - -