get_cla_list Subroutine

private subroutine get_cla_list(self, pref, val)

Get CLA multiple values.

Type Bound

command_line_argument

Arguments

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

CLA data.

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

Prefixing string.

class(*), intent(inout) :: val(1:)

CLA values.


Calls

proc~~get_cla_list~~CallsGraph proc~get_cla_list flap_command_line_argument_t::command_line_argument%get_cla_list proc~errored~2 flap_command_line_argument_t::command_line_argument%errored proc~get_cla_list->proc~errored~2 proc~get_cla_list_from_buffer flap_command_line_argument_t::command_line_argument%get_cla_list_from_buffer proc~get_cla_list->proc~get_cla_list_from_buffer proc~is_required_passed~2 flap_command_line_argument_t::command_line_argument%is_required_passed proc~get_cla_list->proc~is_required_passed~2 proc~tokenize flap_utils_m::tokenize proc~get_cla_list->proc~tokenize 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~get_cla_list_from_buffer->proc~errored~2 proc~get_cla_list_from_buffer->proc~tokenize cton cton proc~get_cla_list_from_buffer->cton proc~check_choices flap_command_line_argument_t::command_line_argument%check_choices proc~get_cla_list_from_buffer->proc~check_choices proc~is_required_passed~2->proc~errored~2 proc~colorize_default face::colorize_default interface~colorize->proc~colorize_default proc~check_choices->proc~errored~2 proc~check_choices->proc~tokenize proc~check_choices->cton proc~check_choices->str 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

Called by

proc~~get_cla_list~~CalledByGraph proc~get_cla_list flap_command_line_argument_t::command_line_argument%get_cla_list none~get flap_command_line_argument_t::command_line_argument%get none~get->proc~get_cla_list proc~get_cla_list~2 flap_command_line_interface_t::command_line_interface%get_cla_list proc~get_cla_list~2->none~get proc~get_cla~2 flap_command_line_interface_t::command_line_interface%get_cla proc~get_cla~2->none~get none~get~2 flap_command_line_interface_t::command_line_interface%get none~get~2->proc~get_cla_list~2 none~get~2->proc~get_cla~2 proc~fake_call flap_test_group::fake_call proc~fake_call->none~get~2 program~flap_save_man_page flap_save_man_page program~flap_save_man_page->none~get~2 program~flap_save_usage_to_markdown flap_save_usage_to_markdown program~flap_save_usage_to_markdown->none~get~2 program~flap_test_action_store flap_test_action_store program~flap_test_action_store->none~get~2 program~flap_test_ansi_color_style flap_test_ansi_color_style program~flap_test_ansi_color_style->none~get~2 program~flap_test_basic flap_test_basic program~flap_test_basic->none~get~2 program~flap_test_choices_logical flap_test_choices_logical program~flap_test_choices_logical->none~get~2 program~flap_test_duplicated_clas flap_test_duplicated_clas program~flap_test_duplicated_clas->none~get~2 program~flap_test_group_examples flap_test_group_examples program~flap_test_group_examples->none~get~2 program~flap_test_hidden flap_test_hidden program~flap_test_hidden->none~get~2 program~flap_test_ignore_unknown_clas flap_test_ignore_unknown_clas program~flap_test_ignore_unknown_clas->none~get~2 program~flap_test_minimal flap_test_minimal program~flap_test_minimal->none~get~2 program~flap_test_nargs_insufficient flap_test_nargs_insufficient program~flap_test_nargs_insufficient->none~get~2 program~flap_test_nargs_insufficient~2 flap_test_nargs_insufficient program~flap_test_nargs_insufficient~2->none~get~2 program~flap_test_nested flap_test_nested program~flap_test_nested->none~get~2 program~flap_test_string flap_test_string program~flap_test_string->none~get~2 program~flap_test_group flap_test_group program~flap_test_group->proc~fake_call

Source Code

  subroutine get_cla_list(self, pref, val)
  !< Get CLA multiple values.
  class(command_line_argument), intent(inout) :: self     !< CLA data.
  character(*), optional,       intent(in)    :: pref     !< Prefixing string.
  class(*),                     intent(inout) :: val(1:)  !< CLA values.
  integer(I4P)                                :: Nv       !< Number of values.
  character(len=len(self%def)), allocatable   :: valsD(:) !< String array of values based on self%def.
  integer(I4P)                                :: v        !< Values counter.

  if (.not.self%is_required_passed(pref=pref)) return
  if (.not.allocated(self%nargs)) then
    call self%errored(pref=pref,error=ERROR_NO_LIST)
    return
  endif
  if (self%act==action_store) then
    if (self%is_passed) then
      call self%get_cla_list_from_buffer(buffer=self%val, val=val, pref=pref)
    else ! using default value
      call self%get_cla_list_from_buffer(buffer=self%def, val=val, pref=pref)
    endif
  elseif (self%act==action_store_true) then
    if (self%is_passed) then
      select type(val)
      type is(logical)
        val = .true.
      endselect
    else
      call tokenize(strin=self%def, delimiter=' ', toks=valsD, Nt=Nv)
      select type(val)
      type is(logical)
        do v=1,Nv
          read(valsD(v),*)val(v)
        enddo
      endselect
    endif
  elseif (self%act==action_store_false) then
    if (self%is_passed) then
      select type(val)
      type is(logical)
        val = .false.
      endselect
    else
      call tokenize(strin=self%def, delimiter=' ', toks=valsD, Nt=Nv)
      select type(val)
      type is(logical)
        do v=1, Nv
          read(valsD(v),*)val(v)
        enddo
      endselect
    endif
  endif
  endsubroutine get_cla_list