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) } component/cli/cli.go +5 −2 Original line number Diff line number Diff line package cli import "fmt" import ( "cac" "fmt" ) // CLI structure type CLI struct { Loading @@ -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) ) version/version.go +10 −0 Original line number Diff line number Diff line Loading @@ -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" ) 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) }
component/cli/cli.go +5 −2 Original line number Diff line number Diff line package cli import "fmt" import ( "cac" "fmt" ) // CLI structure type CLI struct { Loading @@ -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) )
version/version.go +10 −0 Original line number Diff line number Diff line Loading @@ -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" ) Loading