mirror of
https://github.com/ralsina/tartrazine.git
synced 2024-11-10 13:32:24 +00:00
Merge pull request #116 from darkowlzz/version-flag
cli: add version flag
This commit is contained in:
commit
0e34e06c8c
@ -25,8 +25,14 @@ func main() {
|
||||
flag.Usage = usage
|
||||
breakdownFlag := flag.Bool("breakdown", false, "")
|
||||
jsonFlag := flag.Bool("json", false, "")
|
||||
showVersion := flag.Bool("version", false, "Show the enry version information")
|
||||
flag.Parse()
|
||||
|
||||
if *showVersion {
|
||||
fmt.Println(version)
|
||||
return
|
||||
}
|
||||
|
||||
root, err := filepath.Abs(flag.Arg(0))
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
@ -129,6 +135,7 @@ func usage() {
|
||||
usage: %[1]s <path>
|
||||
%[1]s [-json] [-breakdown] <path>
|
||||
%[1]s [-json] [-breakdown]
|
||||
%[1]s [-version]
|
||||
`,
|
||||
os.Args[0], version, build, commit, data.LinguistCommit[:7],
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user