577 type(args),
intent(inout) :: arg
578 logical,
intent(in),
optional :: force
579 logical :: opt_help, found, end
580 character(STRING) :: val_help, options_msg, help_msg, category
581 character(STRING),
pointer :: localopts(:) => null()
583 character(len = *),
parameter :: subname =
'DCArgsHelp' 585 if (.not. arg % initialized)
then 586 call messagenotify(
'W', subname,
'Call Open before Help in dc_args.')
589 call dcargsoption(arg,
stoa(
'-h',
'-H',
'--help'), opt_help, val_help, &
590 & help=
"display this help and exit. " // &
591 &
"VAL is unit number (default is standard output)")
595 if (trim(val_help) ==
'')
then 598 unit =
stoi(val_help)
603 call dchashget(arg % helpmsg,
'TITLE', help_msg, found)
605 call printf(unit,
'%c', c1=trim(help_msg))
610 call dchashget(arg % helpmsg,
'OVERVIEW', help_msg, found)
612 call printf(unit,
'Overview::')
613 call printautolinefeed(unit, help_msg, indent=
' ')
618 call dchashget(arg % helpmsg,
'USAGE', help_msg, found)
620 call printf(unit,
'Usage::')
621 call printautolinefeed(unit, help_msg, indent=
' ')
626 call printf(unit,
'Options::')
627 if (
associated(arg % opt_table) )
then 628 do i = 1,
size(arg % opt_table)
630 if (arg % opt_table(i) % optvalue_flag)
then 631 call concat(arg % opt_table(i) % options,
'=VAL', localopts)
633 allocate(localopts(
size(arg % opt_table(i) % options)))
634 localopts = arg % opt_table(i) % options
636 options_msg = trim(options_msg) // trim(
joinchar(localopts))
637 deallocate(localopts)
638 call printf(unit,
' %c', c1=trim(options_msg))
639 call printautolinefeed(unit, &
640 & arg % opt_table(i) % help_message, indent=
' ')
647 call dchashnext(arg % helpmsg, category, help_msg, end)
650 call printf(unit,
'%c%c::', &
651 & c1=trim(
uchar(category(1:1))), c2=trim(
lchar(category(2:))))
652 call printautolinefeed(unit, help_msg, indent=
' ')
657 call dcargsclose(arg)
logical function, public present_and_true(arg)
character(string) function, public joinchar(carray, expr)
integer, parameter, public stdout
標準出力の装置番号
integer, parameter, public string
文字列を保持する 文字型変数の種別型パラメタ