is_passed Function

private function is_passed(self, group, switch, position)

Check if a CLA has been passed.

Type Bound

command_line_interface

Arguments

Type IntentOptional Attributes Name
class(command_line_interface), intent(in) :: self

CLI data.

character(len=*), intent(in), optional :: group

Name of group (command) of CLA.

character(len=*), intent(in), optional :: switch

Switch name.

integer(kind=I4P), intent(in), optional :: position

Position of positional CLA.

Return Value logical

Check if a CLA has been passed.


Calls

proc~~is_passed~2~~CallsGraph proc~is_passed~2 flap_command_line_interface_t::command_line_interface%is_passed proc~is_defined_group flap_command_line_interface_t::command_line_interface%is_defined_group proc~is_passed~2->proc~is_defined_group proc~is_passed flap_command_line_arguments_group_t::command_line_arguments_group%is_passed proc~is_passed~2->proc~is_passed

Called by

proc~~is_passed~2~~CalledByGraph proc~is_passed~2 flap_command_line_interface_t::command_line_interface%is_passed program~flap_test_action_store flap_test_action_store program~flap_test_action_store->proc~is_passed~2 program~flap_test_basic flap_test_basic program~flap_test_basic->proc~is_passed~2

Source Code

  function is_passed(self, group, switch, position)
  !< Check if a CLA has been passed.
  class(command_line_interface), intent(in) :: self      !< CLI data.
  character(*), optional,        intent(in) :: group     !< Name of group (command) of CLA.
  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)                              :: g         !< Counter.

  is_passed = .false.
  if (.not.present(group)) then
    if (present(switch)) then
      is_passed = self%clasg(0)%is_passed(switch=switch)
    elseif (present(position)) then
      is_passed = self%clasg(0)%is_passed(position=position)
    endif
  else
    if (self%is_defined_group(group=group, g=g)) then
      if (present(switch)) then
        is_passed = self%clasg(g)%is_passed(switch=switch)
      elseif (present(position)) then
        is_passed = self%clasg(g)%is_passed(position=position)
      endif
    endif
  endif
  endfunction is_passed