Add help message
Adds a message to be displayed when using subroutine DCArgsHelp. Messages with category set to "Title", "Overview", or "Usage" are displayed above "Options", while others are displayed below. Give the message to msg.
Example
program dc_args_sample3
implicit none
type(ARGS) :: arg
logical :: OPT_namelist
character(STRING) :: VAL_namelist
character(STRING), pointer :: argv(:) => null()
integer :: i
& msg = 'dcargs :: Test program of dc_args' )
& msg = 'dcargs [Options] arg1, arg2, ...')
& flag = opt_namelist,
value = val_namelist,
help =
"Namelist filename")
& msg = '(1) Define type "HASH". (2) Open the variable. ...')
& msg = 'Copyright (C) GFD Dennou Club, 2008. All rights reserved.')
write(*,*) '--namelist=', trim( val_namelist )
do i = 1, size(argv)
write(*,*) argv(i)
end do
deallocate( argv )
end program dc_args_sample3
Command line arguments parser.
Handling character types.
Provides kind type parameter values.
By specifying any of '-h', '-H', '–help' options in command line arguments, the message given by HelpMsg and the list of options are displayed to standard output.
- Parameters
-
| [in,out] | arg | ARGS derived type variable |
| [in] | category | Category name ("Title", "Overview", "Usage", etc.) |
| [in] | msg | Help message to add |
Definition at line 939 of file dc_args.f90.
943 implicit none
944 type(ARGS), intent(inout) :: arg
945 character(*), intent(in) :: category
946 character(*), intent(in) :: msg
947 character(len = *), parameter :: subname = 'DCArgsHelpMsg'
948 continue
949 if (.not. arg % initialized) then
950 call messagenotify(
'W', subname,
'Call Open before Help in dc_args.')
951 call dcargsopen(arg)
952 end if
Hash (associative array) module.