gtool5 Fortran 90/95 Library 1.0.0-rc5
日本語
Loading...
Searching...
No Matches
dc_args::helpmsg Interface Reference

Public Member Functions

subroutine dcargshelpmsg0 (arg, category, msg)

Detailed Description

Definition at line 350 of file dc_args.f90.

Member Function/Subroutine Documentation

◆ dcargshelpmsg0()

subroutine dc_args::helpmsg::dcargshelpmsg0 ( type(args), intent(inout) arg,
character(*), intent(in) category,
character(*), intent(in) msg )

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
use dc_string, only: stoa
use dc_args
implicit none
type(ARGS) :: arg
logical :: OPT_namelist
character(STRING) :: VAL_namelist
character(STRING), pointer :: argv(:) => null()
integer :: i
call dcargsopen( arg = arg )
call dcargshelpmsg( arg = arg, category = 'Title', &
& msg = 'dcargs :: Test program of dc_args' )
call dcargshelpmsg( arg = arg, category = 'Usage', &
& msg = 'dcargs [Options] arg1, arg2, ...')
call dcargsoption( arg = arg, options = stoa('-N', '--namelist'), &
& flag = opt_namelist, value = val_namelist, help = )
call dcargshelpmsg( arg = arg, category = 'DESCRIPTION', &
& msg = '(1) Define type . (2) Open the variable. ...')
call dcargshelpmsg( arg = arg, category = 'Copyright', &
& msg = 'Copyright (C) GFD Dennou Club, 2008. All rights reserved.')
call dcargsdebug( arg = arg )
call dcargshelp( arg = arg )
call dcargsstrict( arg = arg )
call dcargsget( arg = arg, argv = argv )
write(*,*) '--namelist=', trim( val_namelist )
do i = 1, size(argv)
write(*,*) argv(i)
end do
deallocate( argv )
call dcargsclose( arg = arg )
end program dc_args_sample3
Command line arguments parser.
Definition dc_args.f90:193
Handling character types.
Definition dc_string.f90:83
Provides kind type parameter values.
Definition dc_types.f90:55

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]argARGS derived type variable
[in]categoryCategory name ("Title", "Overview", "Usage", etc.)
[in]msgHelp message to add

Definition at line 939 of file dc_args.f90.

940 use dc_hash, only: dchashput
941 use dc_string, only: uchar
942 use dc_message, only: messagenotify
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
953 call dchashput(arg % helpmsg, key=uchar(category), value=msg)
Hash (associative array) module.
Definition dc_hash.f90:143
Message output module.

The documentation for this interface was generated from the following file: