Skip to content

Commit

Permalink
fixes #60 Needs to provide a --version flag
Browse files Browse the repository at this point in the history
  • Loading branch information
andy-miracl committed Apr 14, 2018
1 parent 9c3cad8 commit 4c34a5b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions conflate/main.go
Expand Up @@ -9,6 +9,8 @@ import (
"strings"
)

var version = "devel"

func failIfError(err error) {
if err != nil {
fmt.Println(err)
Expand All @@ -27,9 +29,15 @@ func main() {
includes := flag.String("includes", "includes", "Name of includes array. Blank string suppresses expansion of includes arrays")
noincludes := flag.Bool("noincludes", false, "Switches off conflation of includes. Overrides any --includes setting.")
expand := flag.Bool("expand", false, "Expand environment variables in files")
showVersion := flag.Bool("version", false, "Display the version number")

flag.Parse()

if *showVersion {
fmt.Println(version)
return
}

conflate.Includes = *includes
if *noincludes {
conflate.Includes = ""
Expand Down

0 comments on commit 4c34a5b

Please sign in to comment.