5.3.4.24. Function args_find_int_min_max¶
Defined in File args.h
5.3.4.24.1. Function Documentation¶
-
int args_find_int_min_max(int argc, char **argv, const char *arg, int def, int min, int max)¶
Find an argument and return its corresponding value as an integer value. This function also tests that the returned value is between the \([min;max]\) range. If it is not the case, it prints an error message and exits the program with
-1value.- Parameters
argc – Number of arguments in
argvarray of arguments.argv – Array of arguments.
arg – Argument to look for. Note that a list of arguments can be provided: arguments have to be separated by a comma (‘,’) character.
def – Default value if the argument is not found.
min – Minimum accepted value.
max – Maximum accepted value.
- Returns
Value corresponding to the argument if it exists in the command line,
defvalue otherwise.