mirror of
https://github.com/SagerNet/sing-box.git
synced 2025-08-03 17:17:36 +08:00
22 lines
480 B
Go
22 lines
480 B
Go
package main
|
|
|
|
import (
|
|
"os"
|
|
"runtime"
|
|
|
|
C "github.com/sagernet/sing-box/constant"
|
|
F "github.com/sagernet/sing/common/format"
|
|
|
|
"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"))
|
|
}
|