Get CLA (multiple) value with varying size, integer(I2P).
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(command_line_argument), | intent(inout) | :: | self |
CLA data. |
||
integer(kind=I2P), | intent(out), | allocatable | :: | val(:) |
CLA values. |
|
character(len=*), | intent(in), | optional | :: | pref |
Prefixing string. |
subroutine get_cla_list_varying_I2P(self, val, pref) !< Get CLA (multiple) value with varying size, integer(I2P). class(command_line_argument), intent(inout) :: self !< CLA data. integer(I2P), allocatable, intent(out) :: val(:) !< CLA values. character(*), optional, intent(in) :: pref !< Prefixing string. integer(I4P) :: Nv !< Number of values. character(len=len(self%val)), allocatable :: valsV(:) !< String array of values based on self%val. 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 tokenize(strin=self%val, delimiter=ARGS_SEP, toks=valsV, Nt=Nv) if (.not.self%check_list_size(Nv=Nv, val=valsV(1), pref=pref)) return allocate(integer(I2P):: val(1:Nv)) do v=1, Nv val(v) = cton(pref=pref, error=self%error, str=trim(adjustl(valsV(v))), knd=1_I2P) if (self%error/=0) exit enddo else ! using default value call tokenize(strin=self%def, delimiter=ARGS_SEP, toks=valsD, Nt=Nv) if (.not.self%check_list_size(Nv=Nv, val=valsD(1), pref=pref)) return allocate(integer(I2P):: val(1:Nv)) do v=1, Nv val(v) = cton(pref=pref, error=self%error, str=trim(adjustl(valsD(v))), knd=1_I2P) if (self%error/=0) exit enddo endif endif endsubroutine get_cla_list_varying_I2P