Check if a CLA has been passed.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(command_line_arguments_group), | intent(in) | :: | self |
CLAsG data. |
||
character(len=*), | intent(in), | optional | :: | switch |
Switch name. |
|
integer(kind=I4P), | intent(in), | optional | :: | position |
Position of positional CLA. |
Check if a CLA has been passed.
pure function is_passed(self, switch, position) !< Check if a CLA has been passed. class(command_line_arguments_group), intent(in) :: self !< CLAsG data. character(*), optional, intent(in) :: switch !< Switch name. integer(I4P), optional, intent(in) :: position !< Position of positional CLA. logical :: is_passed !< Check if a CLA has been passed. integer(I4P) :: a !< CLA counter. is_passed = .false. if (self%Na>0) then if (present(switch)) then do a=1, self%Na if (.not.self%cla(a)%is_positional) then if ((self%cla(a)%switch==switch).or.(self%cla(a)%switch_ab==switch)) then is_passed = self%cla(a)%is_passed exit endif endif enddo elseif (present(position)) then is_passed = self%cla(position)%is_passed endif endif endfunction is_passed