allow for dynamic detection of error-marked values during error printouts
This commit is contained in:
parent
be39097f63
commit
a2601eb15e
16
src/main.c
16
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;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue