2019-01-06 06:44:33 +08:00
|
|
|
package cmd
|
|
|
|
|
|
|
|
import (
|
2019-02-15 19:54:44 +08:00
|
|
|
"fmt"
|
2019-01-06 06:44:33 +08:00
|
|
|
|
|
|
|
"github.com/spf13/cobra"
|
2020-06-01 07:12:36 +08:00
|
|
|
|
|
|
|
"github.com/filebrowser/filebrowser/v2/version"
|
2019-01-06 06:44:33 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
rootCmd.AddCommand(versionCmd)
|
|
|
|
}
|
|
|
|
|
|
|
|
var versionCmd = &cobra.Command{
|
|
|
|
Use: "version",
|
2019-02-15 19:54:44 +08:00
|
|
|
Short: "Print the version number",
|
2019-01-06 06:44:33 +08:00
|
|
|
Run: func(cmd *cobra.Command, args []string) {
|
2019-05-13 04:08:43 +08:00
|
|
|
fmt.Println("File Browser v" + version.Version + "/" + version.CommitSHA)
|
2019-01-06 06:44:33 +08:00
|
|
|
},
|
|
|
|
}
|