feat: #36 从网卡获取IP地址; 自定义IP地址

This commit is contained in:
Akizon77
2025-11-04 15:06:53 +08:00
parent 77dbb9e487
commit d30161651f
3 changed files with 100 additions and 8 deletions

View File

@@ -22,4 +22,7 @@ var (
CustomDNS string
EnableGPU bool // 启用详细GPU监控
ShowWarning bool // Windows 上显示安全警告,作为子进程运行一次
CustomIpv4 string
CustomIpv6 string
GetIpAddrFromNic bool // 从网卡获取IP地址
)

View File

@@ -154,5 +154,8 @@ func init() {
RootCmd.PersistentFlags().StringVar(&flags.CustomDNS, "custom-dns", "", "Custom DNS server to use (e.g. 8.8.8.8, 114.114.114.114). By default, the program uses the system DNS resolver.")
RootCmd.PersistentFlags().BoolVar(&flags.EnableGPU, "gpu", false, "Enable detailed GPU monitoring (usage, memory, multi-GPU support)")
RootCmd.PersistentFlags().BoolVar(&flags.ShowWarning, "show-warning", false, "Show security warning on Windows, run once as a subprocess")
RootCmd.PersistentFlags().StringVar(&flags.CustomIpv4, "custom-ipv4", "", "Custom IPv4 address to use")
RootCmd.PersistentFlags().StringVar(&flags.CustomIpv6, "custom-ipv6", "", "Custom IPv6 address to use")
RootCmd.PersistentFlags().BoolVar(&flags.GetIpAddrFromNic, "get-ip-addr-from-nic", false, "Get IP address from network interface")
RootCmd.PersistentFlags().ParseErrorsWhitelist.UnknownFlags = true
}