gtool5 Fortran 90/95 ライブラリ 1.0.0-rc5
English
Loading...
Searching...
No Matches
dc_args::dcargshelpmsg Interface Reference

Public Member Functions

subroutine dcargshelpmsg0 (arg, category, msg)

Detailed Description

Definition at line 307 of file dc_args.f90.

Member Function/Subroutine Documentation

◆ dcargshelpmsg0()

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

ヘルプメッセージを追加

サブルーチン DCArgsHelp を使用した際に出力されるメッセージを 付加します. category に "Title", "Overview", "Usage" が 指定されたものは "Options" よりも上部に, それ以外のものは下部に表示されます. msg にはメッセージを与えてください.

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
コマンドライン引数の解析
Definition dc_args.f90:193
文字型変数の操作
Definition dc_string.f90:83
種別型パラメタを提供します。
Definition dc_types.f90:55

コマンドライン引数に '-h', '-H', '–help' のいづれかのオプション を指定することで, HelpMsg で与えたメッセージと, オプションの一覧 が標準出力に表示されます.

Parameters
[in,out]argARGS 型変数
[in]categoryカテゴリ名 ("Title", "Overview", "Usage" など)
[in]msg追加するヘルプメッセージ

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)
ハッシュ (連想配列) モジュール
Definition dc_hash.f90:143
メッセージの出力

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