summaryrefslogtreecommitdiff
path: root/version.go
blob: 0b923e536b81c086269c6bb7bedf9b0fa50af0db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package prep

// initializes logging and command line options

import (
	"fmt"
	"os"

	"go.wit.com/lib/cobol"
	"go.wit.com/log"
)

func (pb *Auto) Version() string {
	return pb.getVersion()
}

func doVersion(pb *Auto) {
	log.Info(pb.getVersion())
	os.Exit(0)
}

func (pb *Auto) getVersion() string {
	if myAuto.buildtime == nil {
		return "app doesn't have argv.BuildVersion()"
	}
	BUILDTIME, VERSION := myAuto.buildtime()

	return fmt.Sprintf("%s %s    Built on  %s", pb.Argname, VERSION, cobol.Time(BUILDTIME))
}

func StandardVersion(ARGNAME, VERSION, BUILDTIME string) string {
	return fmt.Sprintf("%s %s    Built on  %s", ARGNAME, VERSION, cobol.Time(BUILDTIME))
}