23 lines
415 B
Go
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
|
||
|
}
|