libsim  Versione6.3.0

◆ optionparser_add_iarray()

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

Add a new option with an integer type array argument.

When parsing will be performed, if the requested option is encountered, its corresponding compulsory argument will be copied into the provided destination. The argument must be provided in the form of comma-separated list of values and is stored in an object of type arrayof_integer (module array_utilities). 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 1209 del file optionparser_class.F90.

1209 ! print usage message
1210 IF (ASSOCIATED(this%usage_msg)) THEN
1211  help_line = line_split_new(cstr_to_fchar(this%usage_msg), ncols)
1212  DO j = 1, line_split_get_nlines(help_line)
1213  WRITE(*,'(A)')trim(line_split_get_line(help_line,j))
1214  ENDDO
1215  CALL delete(help_line)
1216 ELSE
1217  CALL getarg(0, buf)
1218  i = index(buf, '/', back=.true.) ! remove directory part
1219  IF (buf(i+1:i+3) == 'lt-') i = i + 3 ! remove automake prefix
1220  WRITE(*,'(A)')'Usage: '//trim(buf(i+1:))//' [options] [arguments]'
1221 ENDIF
1222 
1223 ! print description message
1224 IF (ASSOCIATED(this%description_msg)) THEN
1225  WRITE(*,'()')
1226  help_line = line_split_new(cstr_to_fchar(this%description_msg), ncols)
1227  DO j = 1, line_split_get_nlines(help_line)
1228  WRITE(*,'(A)')trim(line_split_get_line(help_line,j))
1229  ENDDO
1230  CALL delete(help_line)
1231 ENDIF
1232 
1233 WRITE(*,'(/,A)')'Options:'
1234 
1235 DO i = 1, this%options%arraysize ! loop over options
1236  CALL option_format_help(this%options%array(i), ncols)
1237 ENDDO
1238 
1239 END SUBROUTINE optionparser_printhelptxt
1240 
1241 
Distruttori per le 2 classi.
Index method.

Generated with Doxygen.