is_required_val_passed Function

private function is_required_val_passed(self, pref) result(is_ok)

Check if required value of CLA is passed.

Arguments

Type IntentOptional Attributes Name
class(command_line_argument), intent(inout) :: self

CLA data.

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

Prefixing string.

Return Value logical

Check result.


Calls

proc~~is_required_val_passed~~CallsGraph proc~is_required_val_passed flap_command_line_argument_t::is_required_val_passed proc~errored~2 flap_command_line_argument_t::command_line_argument%errored proc~is_required_val_passed->proc~errored~2 interface~colorize face::colorize proc~errored~2->interface~colorize proc~print_error_message flap_object_t::object%print_error_message proc~errored~2->proc~print_error_message str str proc~errored~2->str proc~colorize_default face::colorize_default interface~colorize->proc~colorize_default proc~color_index face::color_index proc~colorize_default->proc~color_index proc~style_index face::style_index proc~colorize_default->proc~style_index proc~upper face::upper proc~colorize_default->proc~upper

Source Code

  function is_required_val_passed(self, pref) result(is_ok)
  !< Check if required value of CLA is passed.
  class(command_line_argument), intent(inout) :: self  !< CLA data.
  character(*), optional,       intent(in)    :: pref  !< Prefixing string.
  logical                                     :: is_ok !< Check result.

  is_ok = .true.
  if (self%is_val_required.and.((.not.self%is_passed).or.(.not.allocated(self%val)))) then
    call self%errored(pref=pref, error=ERROR_MISSING_REQUIRED_VAL)
    is_ok = .false.
  endif
  endfunction is_required_val_passed