Check CLA multiple values list size consistency.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(command_line_argument), | intent(inout) | :: | self |
CLA data. |
||
integer(kind=I4P), | intent(in) | :: | Nv |
Number of values. |
||
character(len=*), | intent(in) | :: | val |
First value. |
||
character(len=*), | intent(in), | optional | :: | pref |
Prefixing string. |
Check result.
function check_list_size(self, Nv, val, pref) result(is_ok) !< Check CLA multiple values list size consistency. class(command_line_argument), intent(inout) :: self !< CLA data. integer(I4P), intent(in) :: Nv !< Number of values. character(*), intent(in) :: val !< First value. character(*), optional, intent(in) :: pref !< Prefixing string. logical :: is_ok !< Check result. is_ok = .true. if (Nv==1) then if (trim(adjustl(val))=='') then ! there is no real value, but only for nargs=+ this is a real error is_ok = .false. if (self%nargs=='+') then call self%errored(pref=pref, error=ERROR_NARGS_INSUFFICIENT) endif endif endif endfunction check_list_size