filebrowser/cmd/version.go

22 lines
376 B
Go
Raw Normal View History

package cmd
import (
"fmt"
"github.com/spf13/cobra"
2020-05-31 23:12:36 +00:00
"github.com/filebrowser/filebrowser/v2/version"
)
func init() {
rootCmd.AddCommand(versionCmd)
}
var versionCmd = &cobra.Command{
Use: "version",
Short: "Print the version number",
Run: func(cmd *cobra.Command, args []string) {
fmt.Println("File Browser v" + version.Version + "/" + version.CommitSHA)
},
}