Trig error occurrence and print meaningful message.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(command_line_arguments_group), | intent(inout) | :: | self |
CLAsG data. |
||
integer(kind=I4P), | intent(in) | :: | error |
Error occurred. |
||
character(len=*), | intent(in), | optional | :: | pref |
Prefixing string. |
|
integer(kind=I4P), | intent(in), | optional | :: | a1 |
First index CLAs group inconsistent. |
|
integer(kind=I4P), | intent(in), | optional | :: | a2 |
Second index CLAs group inconsistent. |
subroutine errored(self, error, pref, a1, a2) !< Trig error occurrence and print meaningful message. class(command_line_arguments_group), intent(inout) :: self !< CLAsG data. integer(I4P), intent(in) :: error !< Error occurred. character(*), optional, intent(in) :: pref !< Prefixing string. integer(I4P), optional, intent(in) :: a1 !< First index CLAs group inconsistent. integer(I4P), optional, intent(in) :: a2 !< Second index CLAs group inconsistent. character(len=:), allocatable :: prefd !< Prefixing string. self%error = error if (self%error/=0) then prefd = '' ; if (present(pref)) prefd = pref prefd = prefd//self%progname//': '//colorize('error', color_fg=self%error_color, style=self%error_style) select case(self%error) case(ERROR_CONSISTENCY) if (self%group /= '') then self%error_message = prefd//': group (command) name: "'//self%group//'" consistency error:' else self%error_message = prefd//': consistency error:' endif self%error_message = self%error_message//' "'//trim(str(a1, .true.))// & '-th" option has the same switch or abbreviated switch of "'//& trim(str(a2, .true.))//'-th" option:'//new_line('a') self%error_message = self%error_message//prefd//' CLA('//trim(str(a1, .true.)) //') switches = '//self%cla(a1)%switch //' '//& self%cla(a1)%switch_ab//new_line('a') self%error_message = self%error_message//prefd//' CLA('//trim(str(a2, .true.))//') switches = '//self%cla(a2)%switch//' '//& self%cla(a2)%switch_ab case(ERROR_M_EXCLUDE) self%error_message = prefd//': the group "'//self%group//'" and "'//self%m_exclude//'" are mutually'//& ' exclusive, but both have been called!' endselect call self%print_error_message endif endsubroutine errored