libsim  Versione 7.2.1

◆ optionparser_add_i()

subroutine optionparser_add_i ( type(optionparser), intent(inout)  this,
character(len=*), intent(in)  short_opt,
character(len=*), intent(in)  long_opt,
integer, target  dest,
integer, optional  default,
character(len=*), optional  help 
)

Add a new option with an integer type argument.

When parsing will be performed, if the requested option is encountered, its corresponding compulsory argument will be copied into the provided destination. An optional default value can be provided for the destination. Please use the generic optionparser_add method rather than this particular method.

Parametri
[in,out]thisoptionparser object
[in]short_optthe short option (may be empty)
[in]long_optthe long option (may be empty)
destthe destination of the option parse result
defaultthe default value to give to dest if option is not found
helpthe help message that will be formatted and pretty-printed on screen

Definizione alla linea 1149 del file optionparser_class.F90.

1150  'in optionparser, option '''//trim(arg)//''' not valid')
1151  ENDIF
1152  ELSE ! unrecognized = end of options
1153  EXIT
1154  ENDIF
1155  i = i + 1
1156 ENDDO
1157 
1158 nextarg = i
1159 SELECT CASE(status)
1160 CASE(optionparser_err, optionparser_help)
1161  CALL optionparser_printhelp(this)
1162 END SELECT
1163 
1164 END SUBROUTINE optionparser_parse
1165 
1166 
1170 SUBROUTINE optionparser_printhelp(this)
1171 TYPE(optionparser),INTENT(in) :: this
1172 
1173 INTEGER :: i, form
1174 
1175 form = 0
1176 DO i = 1, this%options%arraysize ! loop over options
1177  IF (this%options%array(i)%opttype == opttype_help) THEN

Generated with Doxygen.