diff --git a/cmd/root.go b/cmd/root.go index bf410ed6..f4a160b4 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -41,6 +41,9 @@ func init() { rootCmd.PersistentFlags().BoolVarP(&noConfigure, "no-configure", "n", false, "Don't configure BIRD") } -func Execute() error { +func Execute(v string, c string, d string) error { + version = v + commit = c + date = d return rootCmd.Execute() } diff --git a/main.go b/main.go index 607afbbd..6d928d71 100644 --- a/main.go +++ b/main.go @@ -6,10 +6,17 @@ import ( "github.com/natesales/pathvector/cmd" ) +// Build process flags +var ( + version = "devel" + commit = "unknown" + date = "unknown" +) + //go:generate ./generate.sh func main() { - if err := cmd.Execute(); err != nil { + if err := cmd.Execute(version, commit, date); err != nil { log.Fatal(err) } }