info Subroutine

public subroutine info(self, unit, verbosity)

Show information on git target

Type Bound

git_target_t

Arguments

Type IntentOptional Attributes Name
class(git_target_t), intent(in) :: self

Instance of the git target

integer, intent(in) :: unit

Unit for IO

integer, intent(in), optional :: verbosity

Verbosity of the printout


Variables

Type Visibility Attributes Name Initial
character(len=*), public, parameter :: fmt = '("#", 1x, a, t30, a)'
integer, public :: pr

Source Code

    subroutine info(self, unit, verbosity)

        !> Instance of the git target
        class(git_target_t), intent(in) :: self

        !> Unit for IO
        integer, intent(in) :: unit

        !> Verbosity of the printout
        integer, intent(in), optional :: verbosity

        integer :: pr
        character(len=*), parameter :: fmt = '("#", 1x, a, t30, a)'

        if (present(verbosity)) then
            pr = verbosity
        else
            pr = 1
        end if

        if (pr < 1) return

        write(unit, fmt) "Git target"
        if (allocated(self%url)) then
            write(unit, fmt) "- URL", self%url
        end if
        if (allocated(self%object)) then
            select case(self%descriptor)
            case default
                write(unit, fmt) "- object", self%object
            case(git_descriptor%tag)
                write(unit, fmt) "- tag", self%object
            case(git_descriptor%branch)
                write(unit, fmt) "- branch", self%object
            case(git_descriptor%revision)
                write(unit, fmt) "- sha1", self%object
            end select
        end if

    end subroutine info