summaryrefslogtreecommitdiffstats
path: root/main.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2018-08-08 19:13:13 +1000
committerJesse Duffield <jessedduffield@gmail.com>2018-08-08 19:13:13 +1000
commite8c4bf20f64627f146c7f7923ac742838a56564f (patch)
tree728bf49f8c40eceeb2a5883b9c55b38e4a102c3f /main.go
parent92e75d4602b733e05b1dfdc774f1fc3e15f92cc8 (diff)
parentfbadbdd771985745f46406aaf5ce0ed4c7c35ff7 (diff)
merge master
Diffstat (limited to 'main.go')
-rw-r--r--main.go23
1 files changed, 18 insertions, 5 deletions
diff --git a/main.go b/main.go
index a0b87d716..aedc24b60 100644
--- a/main.go
+++ b/main.go
@@ -16,10 +16,20 @@ import (
// ErrSubProcess is raised when we are running a subprocess
var (
- startTime time.Time
- debugging bool
ErrSubprocess = errors.New("running subprocess")
subprocess *exec.Cmd
+ startTime time.Time
+ debugging bool
+
+ // Rev - Git Revision
+ Rev string
+
+ // Version - Version number
+ Version = "unversioned"
+
+ builddate string
+ debuggingPointer = flag.Bool("debug", false, "a boolean")
+ versionFlag = flag.Bool("v", false, "Print the current version")
)
func homeDirectory() string {
@@ -64,11 +74,14 @@ func navigateToRepoRootDirectory() {
}
func main() {
- debuggingPointer := flag.Bool("debug", false, "a boolean")
- flag.Parse()
+ startTime = time.Now()
debugging = *debuggingPointer
devLog("\n\n\n\n\n\n\n\n\n\n")
- startTime = time.Now()
+ flag.Parse()
+ if *versionFlag {
+ fmt.Printf("rev=%s, build date=%s, version=%s", Rev, builddate, Version)
+ os.Exit(0)
+ }
verifyInGitRepo()
navigateToRepoRootDirectory()
for {