SimpleFileServer/cli/CmdVersion.go
Thorsten Sommer 3d7e638cc6 Initial
2018-09-13 15:30:32 +02:00

23 lines
415 B
Go

package cli
import (
"fileserver/version"
"fmt"
"github.com/spf13/cobra"
)
func cmdVersion() (cmd *cobra.Command) {
cmd = &cobra.Command{
Use: "version",
Short: "Prints the current version",
Args: cobra.NoArgs,
Run: func(cmd *cobra.Command, args []string) {
fmt.Printf("Simple File Server v%s\n", version.VERSION)
fmt.Printf("Compiled with Go %s", version.GetGoversion())
},
}
return
}