get_flag_index Function

public function get_flag_index(arg, flags) result(res)

Arguments

Type IntentOptional Attributes Name
type(arg_element_t), intent(in) :: arg
type(flag_t), intent(in) :: flags(:)

Return Value integer


Source Code

   function get_flag_index(arg, flags) result(res)
      implicit none
      type(arg_element_t), intent(in) :: arg
      type(flag_t), intent(in) :: flags(:)
      integer :: res
      integer :: i

      res = -1
      do i = 1, NUM_FLAGS
         if (arg%v == flags(i)%long_f .or. arg%v == flags(i)%short_f) then
            res = i
            return
         end if
      end do
   end function get_flag_index