![]() |
Stellarator-Tools
|
Base class containing a parsed commandline. More...
Public Member Functions | |
FINAL | commandline_parser_destruct (this) |
Deconstruct a commandline_parser_class object. | |
procedure | get_string (this, arg) |
Get the value of an argument as a string. | |
procedure | get_integer (this, arg, default_value) |
Get the value of an argument as an integer. | |
procedure | get_real (this, arg, default_value) |
Get the value of an argument as a Real. | |
procedure | is_flag_set (this, arg) |
Check if a command line argument was set. | |
Base class containing a parsed commandline.
|
final |
Deconstruct a commandline_parser_class object.
Deallocates memory and uninitializes a commandline_parser_class object.
[in,out] | this | A commandline_parser_class instance. |
procedure commandline_parser::commandline_parser_class::get_integer | ( | class (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 commandline_parser_class instance. |
[in] | arg | A argument string to search for. |
[in] | default_value | Default value in case flag is not set. |
procedure commandline_parser::commandline_parser_class::get_real | ( | class (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 commandline_parser_class instance. |
[in] | arg | A argument string to search for. |
[in] | default_value | Default value in case flag is not set. |
procedure commandline_parser::commandline_parser_class::get_string | ( | class (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 commandline_parser_class instance. |
[in] | arg | A argument string to search for. |
procedure commandline_parser::commandline_parser_class::is_flag_set | ( | class (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 commandline_parser_class instance. |
[in] | arg | A argument string to search for. |