FargparseCLI Function

public function FargparseCLI(unusable, extra_options, cast_extras, rc) result(cap_options)

Arguments

Type IntentOptional Attributes Name
class(KeywordEnforcer), intent(in), optional :: unusable
procedure(I_extraoptions), optional :: extra_options
procedure(I_castextras), optional :: cast_extras
integer, intent(out), optional :: rc

Return Value type(MAPL_CapOptions)


Calls

proc~~fargparsecli~~CallsGraph proc~fargparsecli FargparseCLI initialize initialize proc~fargparsecli->initialize none~add_command_line_options FargparseCLI_Type%add_command_line_options proc~fargparsecli->none~add_command_line_options none~fill_cap_options FargparseCLI_Type%fill_cap_options proc~fargparsecli->none~fill_cap_options parse_args parse_args proc~fargparsecli->parse_args proc~mapl_return MAPL_Return proc~fargparsecli->proc~mapl_return proc~mapl_verify MAPL_Verify proc~fargparsecli->proc~mapl_verify none~add_command_line_options->proc~mapl_return add_argument add_argument none~add_command_line_options->add_argument push_back push_back none~add_command_line_options->push_back none~fill_cap_options->proc~mapl_return none~fill_cap_options->proc~mapl_verify at at none~fill_cap_options->at cast cast none~fill_cap_options->cast interface~mapl_assert MAPL_Assert none~fill_cap_options->interface~mapl_assert of of none~fill_cap_options->of proc~mapl_return->at insert insert proc~mapl_return->insert proc~mapl_throw_exception MAPL_throw_exception proc~mapl_return->proc~mapl_throw_exception proc~mapl_verify->proc~mapl_throw_exception

Source Code

   function FargparseCLI(unusable, extra_options, cast_extras, rc) result (cap_options)
      class(KeywordEnforcer), optional, intent(in) :: unusable
      type (MAPL_CapOptions_) :: cap_options
      procedure(I_extraoptions), optional :: extra_options
      procedure(I_castextras), optional :: cast_extras
      integer, optional, intent(out) :: rc
      integer :: status

      type(FargparseCLI_Type) :: fargparse_cli

      call fargparse_cli%parser%initialize('executable')

      call fargparse_cli%add_command_line_options(fargparse_cli%parser, _RC)

      if (present(extra_options)) then
         call extra_options(fargparse_cli%parser, _RC)
      end if

      fargparse_cli%options = fargparse_cli%parser%parse_args()

      call fargparse_cli%fill_cap_options(cap_options, _RC)

      if (present(cast_extras)) then
         call cast_extras(fargparse_cli, _RC)
      end if

      _RETURN(_SUCCESS)
      _UNUSED_DUMMY(unusable)
   end function FargparseCLI