Files
sing-box-extended-mirror/cmd/sing-box/cmd_version.go
T

22 lines
480 B
Go
Raw Normal View History

2022-07-04 17:08:28 +08:00
package main
import (
"os"
"runtime"
2022-07-06 15:01:09 +08:00
C "github.com/sagernet/sing-box/constant"
2022-07-08 23:03:57 +08:00
F "github.com/sagernet/sing/common/format"
2022-07-06 15:01:09 +08:00
2022-07-04 17:08:28 +08:00
"github.com/spf13/cobra"
)
var commandVersion = &cobra.Command{
Use: "version",
Short: "Print current version of sing-box",
Run: printVersion,
}
func printVersion(cmd *cobra.Command, args []string) {
os.Stderr.WriteString(F.ToString("sing-box version ", C.Version, " (", runtime.Version(), " ", runtime.GOOS, "/", runtime.GOARCH, ")\n"))
}