cli_obj Derived Type

type, public :: cli_obj

A utility to parse command line options


Type-Bound Procedures

procedure, public, nopass :: Get => cli_obj_Get

  • private impure subroutine cli_obj_Get(switch, val, found, default)

    Gets command line options, by looping over command line arguments and finding pairs of the type "-switch value"

    Arguments

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

    Cli switch

    class(*), intent(out) :: val

    Value of the switch

    logical, intent(out), optional :: found

    true if switch found

    class(*), intent(in), optional :: default

    Default value

Source Code

  type :: cli_obj
    !> A utility to parse command line options
    contains
      procedure,nopass :: Get     => cli_obj_Get
  end type cli_obj