Merge pull request #71 from sadayuki-matsuno/version2

mv version.go version/version.go to run main.go without compile
This commit is contained in:
Kota Kanbe
2016-05-25 10:12:00 +09:00
2 changed files with 5 additions and 4 deletions

View File

@@ -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))
}

View File

@@ -15,7 +15,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package main
package version
// Name is Vuls
const Name string = "vuls"