mirror of
https://github.com/ralsina/tartrazine.git
synced 2024-11-12 22:42:23 +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
|
flag.Usage = usage
|
||||||
breakdownFlag := flag.Bool("breakdown", false, "")
|
breakdownFlag := flag.Bool("breakdown", false, "")
|
||||||
jsonFlag := flag.Bool("json", false, "")
|
jsonFlag := flag.Bool("json", false, "")
|
||||||
|
showVersion := flag.Bool("version", false, "Show the enry version information")
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
|
if *showVersion {
|
||||||
|
fmt.Println(version)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
root, err := filepath.Abs(flag.Arg(0))
|
root, err := filepath.Abs(flag.Arg(0))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
@ -129,6 +135,7 @@ func usage() {
|
|||||||
usage: %[1]s <path>
|
usage: %[1]s <path>
|
||||||
%[1]s [-json] [-breakdown] <path>
|
%[1]s [-json] [-breakdown] <path>
|
||||||
%[1]s [-json] [-breakdown]
|
%[1]s [-json] [-breakdown]
|
||||||
|
%[1]s [-version]
|
||||||
`,
|
`,
|
||||||
os.Args[0], version, build, commit, data.LinguistCommit[:7],
|
os.Args[0], version, build, commit, data.LinguistCommit[:7],
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user