V3FIT
|
Defines the base class of the type bmw_commandline_parser_class. More...
Data Types | |
type | bmw_commandline_parser_class |
Base class containing a parsed bmw_commandline. More... | |
Functions/Subroutines | |
type(bmw_commandline_parser_class) function, pointer | bmw_commandline_parser_construct (parallel) |
Construct a bmw_commandline_parser_class object. More... | |
subroutine | bmw_commandline_parser_destruct (this) |
Deconstruct a bmw_commandline_parser_class object. More... | |
character(len=path_length) function | bmw_commandline_parser_get_string (this, arg) |
Get the value of an argument as a string. More... | |
integer function | bmw_commandline_parser_get_integer (this, arg, default_value) |
Get the value of an argument as an integer. More... | |
real(rprec) function | bmw_commandline_parser_get_real (this, arg, default_value) |
Get the value of an argument as a Real. More... | |
logical function | bmw_commandline_parser_is_flag_set (this, arg) |
Check if a command line argument was set. More... | |
subroutine | bmw_commandline_parser_flag_requires_value (this, index) |
Check if a command line argument requires a value. More... | |
subroutine | bmw_commandline_parser_print_help |
Print out help text. More... | |
Variables | |
integer, parameter, private | max_arg_length = 8 |
Maximum length of the argument including the '-' character. | |
integer, parameter, private | max_length = path_length + max_arg_length + 1 |
Maximum length of the complete flag. All command line flags take the form of '-flag=value'. | |
integer, parameter | bmw_commandline_parser_no_error = 0 |
Commandline argument not found. | |
integer, parameter | bmw_commandline_parser_arg_not_found = -1 |
Commandline argument not found. | |
Defines the base class of the type bmw_commandline_parser_class.
type (bmw_commandline_parser_class) function, pointer bmw_commandline_parser::bmw_commandline_parser_construct | ( | type (bmw_parallel_context_class), intent(in) | parallel | ) |
Construct a bmw_commandline_parser_class object.
Allocates memory and initializes a bmw_commandline_parser_class object. The command line is parsed assuming the the flags take the form of -flag=value. If the '=' is missing, it is assumed there is no value. If -h is found, the help text is printed out and the program terminated.
[in] | parallel | bmw_parallel_context_class object instance. |
Definition at line 118 of file bmw_commandline_parser.f.
subroutine bmw_commandline_parser::bmw_commandline_parser_destruct | ( | type (bmw_commandline_parser_class), pointer | this | ) |
Deconstruct a bmw_commandline_parser_class object.
Deallocates memory and uninitializes a bmw_commandline_parser_class object.
[in,out] | this | A bmw_commandline_parser_class instance. |
Definition at line 198 of file bmw_commandline_parser.f.
subroutine bmw_commandline_parser::bmw_commandline_parser_flag_requires_value | ( | type (bmw_commandline_parser_class), intent(in) | this, |
integer, intent(in) | index | ||
) |
Check if a command line argument requires a value.
Command line arguments for
require a value to be set.
[in] | this | A bmw_commandline_parser_class instance. |
[in] | index | A argument string to search for. |
Definition at line 450 of file bmw_commandline_parser.f.
integer function bmw_commandline_parser::bmw_commandline_parser_get_integer | ( | type (bmw_commandline_parser_class), intent(in) | this, |
character (len=*), intent(in) | arg, | ||
integer, intent(in) | default_value | ||
) |
Get the value of an argument as an integer.
Searches the parsed command line flags for a matching command like argument. If no matching argument is found, no value was set or the value cannot be converted to an integer, the default value is returned. Command line arguments take the form of -flag.
[in] | this | A bmw_commandline_parser_class instance. |
[in] | arg | A argument string to search for. |
[in] | default_value | Default value in case flag is not set. |
Definition at line 285 of file bmw_commandline_parser.f.
real (rprec) function bmw_commandline_parser::bmw_commandline_parser_get_real | ( | type (bmw_commandline_parser_class), intent(in) | this, |
character (len=*), intent(in) | arg, | ||
real (rprec), intent(in) | default_value | ||
) |
Get the value of an argument as a Real.
Searches the parsed command line flags for a matching command like argument. If no matching argument is found, no value was set or the value cannot be converted to an integer, the default value is returned. Command line arguments take the form of -flag.
[in] | this | A bmw_commandline_parser_class instance. |
[in] | arg | A argument string to search for. |
[in] | default_value | Default value in case flag is not set. |
Definition at line 340 of file bmw_commandline_parser.f.
character (len=path_length) function bmw_commandline_parser::bmw_commandline_parser_get_string | ( | type (bmw_commandline_parser_class), intent(in) | this, |
character (len=*), intent(in) | arg | ||
) |
Get the value of an argument as a string.
Searches the parsed command line flags for a matching command like argument. If no matching argument is found or no value was set, a blank string is returned. command line arguments take the form of -flag.
[in] | this | A bmw_commandline_parser_class instance. |
[in] | arg | A argument string to search for. |
Definition at line 234 of file bmw_commandline_parser.f.
logical function bmw_commandline_parser::bmw_commandline_parser_is_flag_set | ( | type (bmw_commandline_parser_class), intent(in) | this, |
character (len=*), intent(in) | arg | ||
) |
Check if a command line argument was set.
Searches the parsed command line flags for a matching command line argument. If no matching argument is found the flag was not set.
[in] | this | A bmw_commandline_parser_class instance. |
[in] | arg | A argument string to search for. |
Definition at line 393 of file bmw_commandline_parser.f.
subroutine bmw_commandline_parser::bmw_commandline_parser_print_help |
Print out help text.
Command line help text should take the form of '-flag' that is maximum length of max_arg_length followed by a space. A Y or N indicating the flag takes a value or not followed by a space. A short message describing the flag. A reference for all the command line arguments can be found at Command Line Arguments.
Definition at line 492 of file bmw_commandline_parser.f.