Merge pull request #71 from mcarmonaa/fix/cli-version

added version to cli
This commit is contained in:
Santiago M. Mola
2017-07-10 17:51:03 +02:00
committed by GitHub
3 changed files with 26 additions and 2 deletions

View File

@ -13,6 +13,11 @@ import (
"gopkg.in/src-d/enry.v1"
)
var (
Version = "undefined"
GitHash = "undefined"
)
func main() {
flag.Usage = usage
breakdownFlag := flag.Bool("breakdown", false, "")
@ -105,8 +110,14 @@ func main() {
func usage() {
fmt.Fprintf(
os.Stderr, "enry, A simple (and faster) implementation of github/linguist \nusage: %s <path>\n %s [-json] [-breakdown] <path>\n %s [-json] [-breakdown]\n",
os.Args[0], os.Args[0], os.Args[0],
os.Stderr,
` %[1]s %[2]s commit: %[3]s
enry, A simple (and faster) implementation of github/linguist
usage: %[1]s <path>
%[1]s [-json] [-breakdown] <path>
%[1]s [-json] [-breakdown]
`,
os.Args[0], Version, GitHash,
)
}