Commit 2710264a authored by Boris Mühmer's avatar Boris Mühmer
Browse files

changed visibility of version and title

parent 17f37810
Loading
Loading
Loading
Loading

banner.go

0 → 100644
+12 −0
Original line number Diff line number Diff line
package cac

import "fmt"

const (
	fmtBanner = "%s - version %s (%s)"
)

// Banner returns the program title and some information
func Banner() string {
	return fmt.Sprintf(fmtBanner, cacTitle, cacVersion, cacVersion.Type)
}
+5 −2
Original line number Diff line number Diff line
package cli

import "fmt"
import (
	"cac"
	"fmt"
)

// CLI structure
type CLI struct {
@@ -13,6 +16,6 @@ func New() (*CLI, error) {

// Start is the main entry point
func (c *CLI) Start() error {
	fmt.Println("cac")
	fmt.Printf("%s\n", cac.Banner())
	return nil
}

title.go

0 → 100644
+5 −0
Original line number Diff line number Diff line
package cac

const (
	cacTitle = "cac"
)

version.go

0 → 100644
+10 −0
Original line number Diff line number Diff line
package cac

import (
	"cac/version"
)

// globals
var (
	cacVersion = version.New(0, 0, 0, version.Development)
)
+10 −0
Original line number Diff line number Diff line
@@ -36,6 +36,16 @@ type Version struct {
	Type                  Type
}

// New creates a new version information
func New(major, minor, release uint, t Type) *Version {
	return &Version{
		Major:   major,
		Minor:   minor,
		Release: release,
		Type:    t,
	}
}

const (
	fmtVersion = "%d.%d.%d"
)