dftd3_app_argument Module

Implementation of the argument list processor.


Interfaces

public interface argument_list

Constructor for the argument list

  • private function new_argument_list(argument_counter, argument_getter) result(new)

    Constructor of the argument list

    Arguments

    Type IntentOptional Attributes Name
    procedure(argument_count_interface), optional :: argument_counter

    Argument counter interface

    procedure(get_argument_interface), optional :: argument_getter

    Argument getter interface

    Return Value type(argument_list)

    Newly created argument list

public interface len

  • private pure function get_length(self) result(length)

    Arguments

    Type IntentOptional Attributes Name
    class(argument_list), intent(in) :: self

    Return Value integer


Abstract Interfaces

abstract interface

  • public function argument_count_interface() result(argument_count)

    Interface of the argument counter

    Arguments

    None

    Return Value integer

    Number of available arguments

abstract interface

  • public subroutine get_argument_interface(idx, arg)

    Interface of the argument getter

    Arguments

    Type IntentOptional Attributes Name
    integer, intent(in) :: idx

    Index of the argument to retrieve, range 0 to argument_counter()

    character(len=:), intent(out), allocatable :: arg

    Returned argument payload, allocation status is used to signal errors


Derived Types

type, public ::  argument_list

Argument list class

Components

Type Visibility Attributes Name Initial
type(argument), public, allocatable :: argv(:)

Array of arguments in this list

integer, public :: nargs = 0

Number of arguments

character(len=:), public, allocatable :: prog

Name of the invoked executable, if available

Constructor

Constructor for the argument list

private function new_argument_list (argument_counter, argument_getter)

Constructor of the argument list

Type-Bound Procedures

procedure, public :: get

Get command line argument

procedure, public :: info

Display debug information on this instance

procedure, public :: push_back

Append a command line argument