Module dc_args

module dc_args

        ! Uses
    use dc_types, only : STRING
    use dc_hash, only: HASH

        ! Types
    public type ARGS
    private type OPT_ENTRY
    private type CMD_OPTS_INTERNAL

        ! Variables
    character (len=STRING), private, allocatable, save, dimension (:) :: argstr_table
    integer, private, save :: argind_count = -1
    type (CMD_OPTS_INTERNAL), private, allocatable, save, dimension (:) :: cmd_opts_list
    character (len=STRING), private, allocatable, save, dimension (:) :: cmd_argv_list

        ! Interfaces
    public interface Open
    public interface Close
    public interface Option
    public interface Put_Line
    public interface Debug
    public interface Help
    public interface HelpMsg
    public interface Strict
    public interface Get
    public interface Size

        ! Subroutines and functions
    private subroutine DCArgsOpen (arg)
    private subroutine DCArgsClose (arg)
    private subroutine DCArgsOption (arg, options, flag, value, help)
    private subroutine DCArgsDebug (arg)
    private subroutine DCArgsHelp (arg, force)
    private subroutine DCArgsHelpMsg (arg, category, msg)
    private subroutine DCArgsStrict (arg, severe)
    private subroutine DCArgsGet (arg, argv)
    private function DCArgsSize (arg) result (result)
    private subroutine DCArgsPut_Line (arg)
    private subroutine PrintAutoLinefeed (unit, fmt, length, indent)
    private subroutine SortArgTable ()
    private subroutine BuildArgTable ()
    private function DCOptionFormC (argument, name, value) result (result)

end module dc_args

Description of Types

ARGS

public type ARGS
    private
    type (OPT_ENTRY), pointer, dimension (:) :: opt_table => null ()
    logical :: initialized = .false.
    type (CMD_OPTS_INTERNAL), pointer, dimension (:) :: cmd_opts_list => null ()
    type (HASH) :: helpmsg
end type ARGS

OPT_ENTRY

private type OPT_ENTRY
    character (len=STRING), pointer, dimension (:) :: options => null ()
    character (len=STRING) :: help_message
    logical :: optvalue_flag
end type OPT_ENTRY

CMD_OPTS_INTERNAL

private type CMD_OPTS_INTERNAL
    character (len=STRING) :: name
    character (len=STRING) :: value
    logical :: flag_called = .false.
end type CMD_OPTS_INTERNAL

Description of Variables

argstr_table

character (len=STRING), private, allocatable, save, dimension (:) :: argstr_table

argind_count

integer, private, save :: argind_count = -1

cmd_opts_list

type (CMD_OPTS_INTERNAL), private, allocatable, save, dimension (:) :: cmd_opts_list

cmd_argv_list

character (len=STRING), private, allocatable, save, dimension (:) :: cmd_argv_list

Description of Interfaces

Open

public interface Open
    module procedure DCArgsOpen
end interface Open

Close

public interface Close
    module procedure DCArgsClose
end interface Close

Option

public interface Option
    module procedure DCArgsOption
end interface Option

Put_Line

public interface Put_Line
    module procedure DCArgsPut_Line
end interface Put_Line

Debug

public interface Debug
    module procedure DCArgsDebug
end interface Debug

Help

public interface Help
    module procedure DCArgsHelp
end interface Help

HelpMsg

public interface HelpMsg
    module procedure DCArgsHelpMsg
end interface HelpMsg

Strict

public interface Strict
    module procedure DCArgsStrict
end interface Strict

Get

public interface Get
    module procedure DCArgsGet
end interface Get

Size

public interface Size
    module procedure DCArgsSize
end interface Size

Description of Subroutines and Functions

DCArgsOpen

private subroutine DCArgsOpen (arg)
    type (ARGS), intent(out) :: arg
    ! Calls: BuildArgTable, MessageNotify, SortArgTable
end subroutine DCArgsOpen

DCArgsClose

private subroutine DCArgsClose (arg)
    type (ARGS), intent(inout) :: arg
    ! Calls: Delete
end subroutine DCArgsClose

DCArgsOption

private subroutine DCArgsOption (arg, options, flag, value, help)
    type (ARGS), intent(inout) :: arg
    character (len=*), intent(in), dimension (:) :: options
    logical, intent(out) :: flag
    character (len=*), optional, intent(out) :: value
    character (len=*), optional, intent(in) :: help
    ! Calls: DCArgsOpen, MessageNotify
end subroutine DCArgsOption

DCArgsDebug

private subroutine DCArgsDebug (arg)
    type (ARGS), intent(inout) :: arg
    ! Calls: DCArgsOpen, MessageNotify, Option, SetDebug
end subroutine DCArgsDebug

DCArgsHelp

private subroutine DCArgsHelp (arg, force)
    type (ARGS), intent(inout) :: arg
    logical, optional, intent(in) :: force
    ! Calls: Concat, DCArgsClose, DCArgsOpen, Delete, Get, MessageNotify, Next, Option, PrintAutoLinefeed, Printf, Rewind
end subroutine DCArgsHelp

DCArgsHelpMsg

private subroutine DCArgsHelpMsg (arg, category, msg)
    type (ARGS), intent(inout) :: arg
    character (len=*), intent(in) :: category
    character (len=*), intent(in) :: msg
    ! Calls: DCArgsOpen, MessageNotify, Put
end subroutine DCArgsHelpMsg

DCArgsStrict

private subroutine DCArgsStrict (arg, severe)
    type (ARGS), intent(inout) :: arg
    logical, optional, intent(in) :: severe
    ! Calls: DCArgsOpen, MessageNotify
end subroutine DCArgsStrict

DCArgsGet

private subroutine DCArgsGet (arg, argv)
    type (ARGS), intent(inout) :: arg
    character (len=*), pointer, dimension (:) :: argv
    ! Calls: DCArgsOpen, MessageNotify
end subroutine DCArgsGet

DCArgsSize

private function DCArgsSize (arg) result (result)
    type (ARGS), intent(inout) :: arg
    integer :: result
    ! Calls: DCArgsOpen, MessageNotify
end function DCArgsSize

DCArgsPut_Line

private subroutine DCArgsPut_Line (arg)
    type (ARGS), intent(in) :: arg
    ! Calls: Printf
end subroutine DCArgsPut_Line

PrintAutoLinefeed

private subroutine PrintAutoLinefeed (unit, fmt, length, indent)
    integer, optional, intent(in) :: unit
    character (len=*), intent(in) :: fmt
    integer, optional, intent(in) :: length
    character (len=*), optional, intent(in) :: indent
    ! Calls: Split
end subroutine PrintAutoLinefeed

SortArgTable

private subroutine SortArgTable ()
end subroutine SortArgTable

BuildArgTable

private subroutine BuildArgTable ()
    ! Calls: SysdepArgGet
end subroutine BuildArgTable

DCOptionFormC

private function DCOptionFormC (argument, name, value) result (result)
    character (len=*), intent(in) :: argument
    character (len=*), intent(out) :: name
    character (len=*), intent(out) :: value
    logical :: result
end function DCOptionFormC