From 4c34a5b0ce3eecbb9ce91979b70d5327f2666935 Mon Sep 17 00:00:00 2001 From: Andrew Smith Date: Sat, 14 Apr 2018 00:21:39 +0100 Subject: [PATCH] fixes #60 Needs to provide a --version flag --- conflate/main.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/conflate/main.go b/conflate/main.go index 76b4b1d..17636e6 100644 --- a/conflate/main.go +++ b/conflate/main.go @@ -9,6 +9,8 @@ import ( "strings" ) +var version = "devel" + func failIfError(err error) { if err != nil { fmt.Println(err) @@ -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 = ""