gtool5 Fortran 90/95 ライブラリ 1.0.0-rc5
English
Loading...
Searching...
No Matches
Public Member Functions | List of all members
dc_args::strict Interface Reference

Public Member Functions

subroutine dcargsstrict0 (arg, severe)
 

Detailed Description

Definition at line 354 of file dc_args.f90.

Member Function/Subroutine Documentation

◆ dcargsstrict0()

subroutine dc_args::strict::dcargsstrict0 ( type(args), intent(inout)  arg,
logical, intent(in), optional  severe 
)

オプションチェックを行う

オプションチェックを行います.

コマンドライン引数のオプションとして指定されたものの内, DCArgsOption サブルーチンで設定されていないものが存在する 場合には警告を返します. severe.true. を指定すると エラーを返して終了します. このサブルーチンを呼ぶ前に, DCArgsOption, DCArgsDebug, DCArgsHelp サブルーチンを呼んでください.

構造型 ARGS の変数に対してこのサブルーチンを適用しておく ことで, コマンドライン引数として与えたオプションが正しく プログラムが認識しているかどうかをチェックすることができます.

Parameters
[in,out]argARGS 型変数
[in]severe.true. の場合, エラーを返して終了 (省略可能)

Definition at line 996 of file dc_args.f90.

997 use dc_types, only: string
999 use dc_message, only: messagenotify
1000 implicit none
1001 type(ARGS), intent(inout) :: arg
1002 logical, intent(in), optional :: severe
1003 character(STRING) :: err_mess
1004 integer :: i
1005 character(len = *), parameter :: subname = 'DCArgsStrict'
1006 continue
1007 if (.not. arg % initialized) then
1008 call messagenotify('W', subname, 'Call Open before Help in dc_args.')
1009 call dcargsopen(arg)
1010 end if
1011 do i = 1, size(arg % cmd_opts_list)
1012 err_mess = trim(arg % cmd_opts_list(i) % name) // ' is invalid option.'
1013 if (.not. arg % cmd_opts_list(i) % flag_called) then
1014 if (present_and_true(severe)) then
1015 call messagenotify('E', subname, err_mess)
1016 else
1017 call messagenotify('W', subname, err_mess)
1018 end if
1019 end if
1020 end do
メッセージの出力
省略可能な制御パラメータの判定
logical function, public present_and_true(arg)
種別型パラメタを提供します。
Definition dc_types.f90:55
integer, parameter, public string
文字列を保持する 文字型変数の種別型パラメタ
Definition dc_types.f90:137

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