From 475c51cbd7f6368c13d21f5cf70633636e5a77f8 Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Tue, 16 Aug 2016 11:34:01 -0400 Subject: [PATCH 1/3] version: adding a version variable Signed-off-by: Vincent Batts --- version.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 version.go diff --git a/version.go b/version.go new file mode 100644 index 0000000..7377260 --- /dev/null +++ b/version.go @@ -0,0 +1,18 @@ +package mtree + +import "fmt" + +const ( + // VersionMajor is for an API incompatible changes + VersionMajor = 0 + // VersionMinor is for functionality in a backwards-compatible manner + VersionMinor = 2 + // VersionPatch is for backwards-compatible bug fixes + VersionPatch = 0 + + // VersionDev indicates development branch. Releases will be empty string. + VersionDev = "" +) + +// Version is the specification version that the package types support. +var Version = fmt.Sprintf("%d.%d.%d%s", VersionMajor, VersionMinor, VersionPatch, VersionDev) From 92b6fc1af326c0ed4c8efba6aa657b84b50d3973 Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Tue, 16 Aug 2016 11:37:11 -0400 Subject: [PATCH 2/3] main: expose the version with a flag Signed-off-by: Vincent Batts --- cmd/gomtree/main.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmd/gomtree/main.go b/cmd/gomtree/main.go index ba118d4..f69374d 100644 --- a/cmd/gomtree/main.go +++ b/cmd/gomtree/main.go @@ -26,6 +26,7 @@ var ( flBsdKeywords = flag.Bool("bsd-keywords", false, "only operate on keywords that are supported by upstream mtree(8)") flListUsedKeywords = flag.Bool("list-used", false, "list all the keywords found in a validation manifest") flDebug = flag.Bool("debug", false, "output debug info to STDERR") + flVersion = flag.Bool("version", false, "display the version of this tool") ) var formats = map[string]func(*mtree.Result) string{ @@ -72,6 +73,11 @@ func main() { } }() + if *flVersion { + fmt.Printf("%s :: %s\n", os.Args[0], mtree.Version) + return + } + // -list-keywords if *flListKeywords { fmt.Println("Available keywords:") From 23a95a1c9792ff2aa2936215647ca89c8893fbb7 Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Tue, 16 Aug 2016 11:37:47 -0400 Subject: [PATCH 3/3] version: bump for a dev cycle Signed-off-by: Vincent Batts --- version.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/version.go b/version.go index 7377260..401dd3d 100644 --- a/version.go +++ b/version.go @@ -6,12 +6,12 @@ const ( // VersionMajor is for an API incompatible changes VersionMajor = 0 // VersionMinor is for functionality in a backwards-compatible manner - VersionMinor = 2 + VersionMinor = 3 // VersionPatch is for backwards-compatible bug fixes VersionPatch = 0 // VersionDev indicates development branch. Releases will be empty string. - VersionDev = "" + VersionDev = "-dev" ) // Version is the specification version that the package types support.