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