chore: 启动参数v,查看版本同时打印使用的tags

This commit is contained in:
Skyxim 2022-06-03 20:23:53 +08:00
parent ed9b9ce3c5
commit 298ca42369
4 changed files with 22 additions and 1 deletions

View file

@ -0,0 +1,7 @@
//go:build no_doq
package features
func init() {
TAGS = append(TAGS, "no_doq")
}

View file

@ -0,0 +1,7 @@
//go:build no_gvisor
package features
func init() {
TAGS = append(TAGS, "no_gvisor")
}

View file

@ -0,0 +1,3 @@
package features
var TAGS = make([]string, 0, 0)

View file

@ -3,10 +3,12 @@ package main
import (
"flag"
"fmt"
"github.com/Dreamacro/clash/constant/features"
"os"
"os/signal"
"path/filepath"
"runtime"
"strings"
"syscall"
"github.com/Dreamacro/clash/config"
@ -50,7 +52,9 @@ func init() {
func main() {
_, _ = maxprocs.Set(maxprocs.Logger(func(string, ...any) {}))
if version {
fmt.Printf("Clash Meta %s %s %s with %s %s\n", C.Version, runtime.GOOS, runtime.GOARCH, runtime.Version(), C.BuildTime)
fmt.Printf("Clash Meta %s %s %s with %s %s\n",
C.Version, runtime.GOOS, runtime.GOARCH, runtime.Version(), C.BuildTime)
fmt.Printf("Use tags: %s\n", strings.Join(features.TAGS, ", "))
return
}