Skip to content

Commit

Permalink
Add version flag support. Currently the version is set manually.
Browse files Browse the repository at this point in the history
Signed-off-by: Marios Andreopoulos <[email protected]>
  • Loading branch information
andmarios committed Oct 3, 2016
1 parent 2cadc06 commit cc30450
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ var (
defaultTimeout = flag.Duration("timeout", 5*time.Minute, "default timeout for commands (e.g 2h45m, 60s, 300ms)")
title = flag.String("title", "Coyote Tests", "title to use for report")
outputFile = flag.String("out", "coyote.html", "filename to save the results under, if exists it will be overwritten")
version = flag.Bool("version", false, "print coyote version")
)

var (
Expand All @@ -57,6 +58,11 @@ func init() {
}

func main() {
if *version == true {
fmt.Printf("This is Landoop's Coyote %s.\n", Version)
os.Exit(0)
}

logger := log.New(os.Stdout, "", log.Ldate|log.Ltime)
logger.Printf("Starting coyote-tester\n")

Expand Down
3 changes: 3 additions & 0 deletions version.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package main

const Version = "1.0"

0 comments on commit cc30450

Please sign in to comment.