diff --git a/main.go b/main.go index 6e96e5ad..b5a91614 100644 --- a/main.go +++ b/main.go @@ -25,6 +25,7 @@ import ( "golang.org/x/net/context" "github.com/future-architect/vuls/commands" + "github.com/future-architect/vuls/version" "github.com/google/subcommands" _ "github.com/mattn/go-sqlite3" @@ -40,12 +41,12 @@ func main() { subcommands.Register(&commands.PrepareCmd{}, "prepare") subcommands.Register(&commands.HistoryCmd{}, "history") - var version = flag.Bool("v", false, "Show version") + var v = flag.Bool("v", false, "Show version") flag.Parse() - if *version { - fmt.Printf("%s %s\n", Name, Version) + if *v { + fmt.Printf("%s %s\n", version.Name, version.Version) os.Exit(int(subcommands.ExitSuccess)) } diff --git a/version.go b/version/version.go similarity index 98% rename from version.go rename to version/version.go index 74b7c3ef..f733567a 100644 --- a/version.go +++ b/version/version.go @@ -15,7 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -package main +package version // Name is Vuls const Name string = "vuls"