24 lines
245 B
Go
24 lines
245 B
Go
|
package main
|
||
|
|
||
|
import (
|
||
|
"flag"
|
||
|
"fmt"
|
||
|
)
|
||
|
|
||
|
var (
|
||
|
Version = "impure"
|
||
|
|
||
|
printVersion bool
|
||
|
)
|
||
|
|
||
|
func init() {
|
||
|
flag.BoolVar(&printVersion, "V", false, "Print version")
|
||
|
}
|
||
|
|
||
|
func tryVersion() {
|
||
|
if printVersion {
|
||
|
fmt.Println(Version)
|
||
|
os.Exit(0)
|
||
|
}
|
||
|
}
|