libsim  Versione6.3.0

◆ optionparser_add_r()

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

Add a new option with a real 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 value default 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 1253 del file optionparser_class.F90.

1253 
1254 ! print usage message
1255 WRITE(*,'(A)')'### Synopsis'
1256 
1257 IF (ASSOCIATED(this%usage_msg)) THEN
1258  help_line = line_split_new(mdquote_usage_msg(cstr_to_fchar(this%usage_msg)), ncols)
1259  DO j = 1, line_split_get_nlines(help_line)
1260  WRITE(*,'(A)')trim(line_split_get_line(help_line,j))
1261  ENDDO
1262  CALL delete(help_line)
1263 ELSE
1264  CALL getarg(0, buf)
1265  i = index(buf, '/', back=.true.) ! remove directory part
1266  IF (buf(i+1:i+3) == 'lt-') i = i + 3 ! remove automake prefix
1267  WRITE(*,'(A)')'Usage: `'//trim(buf(i+1:))//' [options] [arguments]`'
1268 ENDIF
1269 
1270 ! print description message
1271 IF (ASSOCIATED(this%description_msg)) THEN
1272  WRITE(*,'()')
1273  WRITE(*,'(A)')'### Description'
1274  help_line = line_split_new(cstr_to_fchar(this%description_msg), ncols)
1275  DO j = 1, line_split_get_nlines(help_line)
1276  WRITE(*,'(A)')trim(line_split_get_line(help_line,j))
1277  ENDDO
1278  CALL delete(help_line)
1279 
1280 ENDIF
Distruttori per le 2 classi.
Index method.

Generated with Doxygen.