BraWl
|
Data Types | |
type | cmd_arg |
type containing a key-value pair More... | |
interface | get_arg |
read arguments by name or number More... | |
type | str_wrapper |
wrapper to allow array of allocatable strings More... | |
Functions/Subroutines | |
subroutine | parse_args () |
Parse out command line args. | |
subroutine | initial_parse |
helper function - do a parse if it hasn't been done yet | |
integer function, public | arg_count () |
get the number of arguments note: total count may not match command_argument_count due to parsing key=value syntax! | |
logical function | get_arg_num_logical (num, val, exists) |
read by number for logical values | |
logical function | get_arg_name_logical (name, val, exists) |
Read by name for logical values. | |
logical function | get_arg_num_dbl (num, val, exists) |
read by number for double precision values | |
logical function | get_arg_name_dbl (name, val, exists) |
read by name for double precision values | |
logical function | get_arg_num_float (num, val, exists) |
Read by number for single precision (float) values. | |
logical function | get_arg_name_float (name, val, exists) |
read by name for single precision (float) values | |
logical function | get_arg_num_int (num, val, exists) |
read by number for integer values | |
logical function | get_arg_name_int (name, val, exists) |
read by name for integer values | |
logical function | get_arg_num_long (num, val, exists) |
read by number for long integer values | |
logical function | get_arg_name_long (name, val, exists) |
read by name for long integer values | |
logical function | get_arg_num_str (num, val, exists) |
read by number for string/character values | |
logical function | get_arg_name_str (name, val, exists) |
read by name for string values | |
logical function, public | arg_present (name, has_value) |
check presence of an argument by name | |
type(str_wrapper) function, dimension(:), allocatable, public | dump_names () |
get all the argument names (by copy) order will probably match input order, but this is not guaranteed | |
character(len=:) function, allocatable, public | get_arg_value (name, exists) |
lookup an argument by name and return the value as an (allocatable) string if the name is not present, an empty string is returned | |
Variables | |
logical | initial_parse_done = .false. |
type(cmd_arg), dimension(:), allocatable, private | all_args |
the argument list | |
integer, private | num_args = 0 |
the number of arguments | |
integer, parameter | max_string_len = 200 |
integer function, public command_line::arg_count |
get the number of arguments note: total count may not match command_argument_count due to parsing key=value syntax!
Definition at line 229 of file command_line.f90.
logical function, public command_line::arg_present | ( | character(len=*), intent(in) | name, |
logical, intent(out), optional | has_value ) |
check presence of an argument by name
name | argument name to look up |
has_value | whether this argument has a defined value (also .false. if not present) |
Definition at line 727 of file command_line.f90.
type(str_wrapper) function, dimension(:), allocatable, public command_line::dump_names |
get all the argument names (by copy) order will probably match input order, but this is not guaranteed
Definition at line 756 of file command_line.f90.
|
private |
read by name for double precision values
name | argument name to look up |
val | value to read into |
exists | whether the name was found |
Definition at line 379 of file command_line.f90.
|
private |
read by name for single precision (float) values
name | argument name to look up |
val | value to read into |
exists | whether the name was found |
Definition at line 453 of file command_line.f90.
|
private |
read by name for integer values
name | argument name to look up |
val | value to read into |
exists | whether the name was found |
Definition at line 521 of file command_line.f90.
|
private |
Read by name for logical values.
Note : a flag (name with no '=value' part) will parse as .true. if present, and .false. if not
name | Argument name to look up |
val | Value to read into |
exists | Whether the name was found |
Definition at line 291 of file command_line.f90.
|
private |
read by name for long integer values
name | argument name to look up |
val | value to read into |
exists | whether the name was found |
Definition at line 601 of file command_line.f90.
|
private |
read by name for string values
Note: if the string passed is shorter than the value, it will be truncated if the length is not known use get_arg_value to get an allocatable string
name | argument name to look up |
val | value to read into |
exists | whether the name was found - this is already contained in the return value, but is given for consistency with the other members |
Definition at line 686 of file command_line.f90.
|
private |
read by number for double precision values
num | argument number to read |
val | value to read into |
exists | whether the name was found |
Definition at line 340 of file command_line.f90.
|
private |
Read by number for single precision (float) values.
num | argument number to read |
val | value to read into |
exists | whether the name was found |
Definition at line 424 of file command_line.f90.
|
private |
read by number for integer values
num | argument number to read |
val | value to read into |
exists | whether the name was found |
Definition at line 482 of file command_line.f90.
|
private |
read by number for logical values
num | argument number to read |
val | value to read into |
exists | whether the name was found |
Definition at line 249 of file command_line.f90.
|
private |
read by number for long integer values
num | argument number to read |
val | value to read into |
exists | whether the name was found |
Definition at line 562 of file command_line.f90.
|
private |
read by number for string/character values
num | argument number to read |
val | value to read into |
exists | whether the name was found - this is already contained in the return value, but is given for consistency with the other members |
Definition at line 643 of file command_line.f90.
character(len=:) function, allocatable, public command_line::get_arg_value | ( | character(len=*), intent(in) | name, |
logical, intent(out), optional | exists ) |
lookup an argument by name and return the value as an (allocatable) string if the name is not present, an empty string is returned
name | argument name to look up |
exists | whether the name was found |
Definition at line 779 of file command_line.f90.
|
private |
helper function - do a parse if it hasn't been done yet
Definition at line 217 of file command_line.f90.
|
private |
Parse out command line args.
This function can be called multiple times and will freshly parse all arguments each time we assume these are entered as 'name=value'. If there is no '=' sign, we set an empty value
Definition at line 101 of file command_line.f90.
|
private |
the argument list
Definition at line 83 of file command_line.f90.
|
private |
Definition at line 41 of file command_line.f90.
|
private |
Definition at line 86 of file command_line.f90.
|
private |