libsim Versione 7.2.6

◆ 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 )
private

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 1224 del file optionparser_class.F90.

1225 WRITE(*,'(A)')trim(line_split_get_line(help_line,j))
1226 ENDDO
1227 CALL delete(help_line)
1228ENDIF
1229
1230WRITE(*,'(/,A)')'Options:'
1231
1232DO i = 1, this%options%arraysize ! loop over options
1233 CALL option_format_help(this%options%array(i), ncols)
1234ENDDO
1235
1236END SUBROUTINE optionparser_printhelptxt
1237
1238
1239!> Print on stdout a markdown representation of the help message.
1240!! It can be called by the user program and it is called anyway if the
1241!! program has been called with the `--help md` option.
1242SUBROUTINE optionparser_printhelpmd(this)
1243TYPE(optionparser),INTENT(in) :: this !< \a optionparser object with correctly initialised options
1244
1245INTEGER :: i, j, ncols
1246CHARACTER(len=80) :: buf
1247TYPE(line_split) :: help_line
1248
1249ncols = default_columns()
1250
1251! print usage message
1252WRITE(*,'(A)')'### Synopsis'

Generated with Doxygen.