Update version output

pull/189/head
Henrique Dias 2017-08-04 13:35:21 +01:00
parent 004f6ef0a2
commit b7887ed162
No known key found for this signature in database
GPG Key ID: 936F5EB68D786730
1 changed files with 11 additions and 2 deletions

View File

@ -86,13 +86,22 @@ func setupViper() {
viper.AddConfigPath(".")
}
func printVersion() {
if version == "" {
fmt.Println("filemanager is at an untracked version")
} else {
fmt.Println("filemanager", version)
}
os.Exit(0)
}
func main() {
setupViper()
flag.Parse()
if showVer {
fmt.Println("filemanager version", version)
os.Exit(0)
printVersion()
}
// Add a configuration file if set.