Get CLA multiple values.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(command_line_argument), | intent(inout) | :: | self |
CLA data. |
||
character(len=*), | intent(in), | optional | :: | pref |
Prefixing string. |
|
class(*), | intent(inout) | :: | val(1:) |
CLA values. |
subroutine get_cla_list(self, pref, val) !< Get CLA multiple values. class(command_line_argument), intent(inout) :: self !< CLA data. character(*), optional, intent(in) :: pref !< Prefixing string. class(*), intent(inout) :: val(1:) !< CLA values. integer(I4P) :: Nv !< Number of values. character(len=len(self%def)), allocatable :: valsD(:) !< String array of values based on self%def. integer(I4P) :: v !< Values counter. if (.not.self%is_required_passed(pref=pref)) return if (.not.allocated(self%nargs)) then call self%errored(pref=pref,error=ERROR_NO_LIST) return endif if (self%act==action_store) then if (self%is_passed) then call self%get_cla_list_from_buffer(buffer=self%val, val=val, pref=pref) else ! using default value call self%get_cla_list_from_buffer(buffer=self%def, val=val, pref=pref) endif elseif (self%act==action_store_true) then if (self%is_passed) then select type(val) type is(logical) val = .true. endselect else call tokenize(strin=self%def, delimiter=' ', toks=valsD, Nt=Nv) select type(val) type is(logical) do v=1,Nv read(valsD(v),*)val(v) enddo endselect endif elseif (self%act==action_store_false) then if (self%is_passed) then select type(val) type is(logical) val = .false. endselect else call tokenize(strin=self%def, delimiter=' ', toks=valsD, Nt=Nv) select type(val) type is(logical) do v=1, Nv read(valsD(v),*)val(v) enddo endselect endif endif endsubroutine get_cla_list