This section is empty.


This section is empty.


This section is empty.


type Flag

type Flag struct {
	AppName string // The application name to use when printing the version

    Flag provides a standardised version flag.

    func (*Flag) AlternativeName

    func (*Flag) AlternativeName() string

      AlternativeName returns the alternative flag name (without leading hyphen).

      func (*Flag) Description

      func (*Flag) Description() string

        Description returns a one-line description of this flag.

        func (*Flag) IsBoolean

        func (*Flag) IsBoolean() bool

          IsBoolean returns true.

          func (*Flag) Name

          func (*Flag) Name() string

            Name returns the flag name (without leading hyphen).

            func (*Flag) Parse

            func (f *Flag) Parse(_ string) error

              Parse outputs the version details to os.Stderr and exits.

              func (*Flag) Usage

              func (*Flag) Usage() string

                Usage returns the empty string.

                type Info

                type Info struct {
                	Major     int
                	Minor     int
                	Patch     int
                	GitCommit string
                	GitDirty  bool
                	Date      time.Time

                  Info contains versioning information.

                  func GetInfo

                  func GetInfo() Info

                    GetInfo returns the known version info.

                    func (Info) String

                    func (i Info) String() string

                      String returns a string summarising the version.

                      func (Info) Version

                      func (i Info) Version() string

                        Version returns the version as a string with leading "v".

                        Source Files