SimpleFileServer/cli/CmdVersion.go

23 lines
415 B
Go
Raw Permalink Normal View History

2018-09-13 13:30:32 +00:00
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)
2018-09-13 19:15:31 +00:00
fmt.Printf("Compiled with Go %s", version.GetGoVersion())
2018-09-13 13:30:32 +00:00
},
}
return
}