command_line_t Derived Type

type, public :: command_line_t


Type-Bound Procedures

generic, public :: argument_present => character_argument_present, string_argument_present

procedure, public, nopass :: character_argument_present

  • interface

    private module function character_argument_present(acceptable_argument) result(found)

    result is .true. only if a command-line argument matches an element of this function's argument

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: acceptable_argument(:)

    sample list: [character(len=len()):: "--benchmark", "-b", "/benchmark", "/b"] where dashes support Linux/macOS, slashes support Windows, and must be replaced by the longest list element ("--benchmark" above)

    Return Value logical

procedure, public, nopass :: character_flag_value

  • interface

    private module function character_flag_value(flag) result(value)

    result = { the value passed immediately after a command-line flag if the flag is present or { an empty string otherwise.

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: flag

    Return Value character(len=:), allocatable

generic, public :: flag_value => character_flag_value, string_flag_value

procedure, public, nopass :: string_argument_present

  • interface

    private module function string_argument_present(acceptable_argument) result(found)

    same as character_argument_present but allowing ragged-edged array of character values

    Arguments

    Type IntentOptional Attributes Name
    type(string_t), intent(in) :: acceptable_argument(:)

    Return Value logical

procedure, public, nopass :: string_flag_value

  • interface

    private module function string_flag_value(flag) result(value)

    same as character_flag_value but accepting a string_t dummy argument

    Arguments

    Type IntentOptional Attributes Name
    type(string_t), intent(in) :: flag

    Return Value character(len=:), allocatable