Skip to content

Commit

Permalink
Merge pull request #64 from miracl/support-version
Browse files Browse the repository at this point in the history
fixes #60 Needs to provide a --version flag
  • Loading branch information
andy-miracl committed Apr 17, 2018
2 parents 9c3cad8 + 4c34a5b commit d830d53
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions conflate/main.go
Original file line number Diff line number Diff line change
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 d830d53

Please sign in to comment.