SimpleFileServer/cli/CmdVersion.go
2018-09-13 21:15:31 +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
}