Chore: Remove ctlcmd and leftover envvar (#5392)

https://github.com/v2fly/v2ray-core/issues/360
This commit is contained in:
𐲓𐳛𐳪𐳂𐳐 𐲀𐳢𐳦𐳫𐳢 𐲥𐳔𐳛𐳪𐳌𐳑𐳖𐳇
2025-12-08 21:27:22 +08:00
committed by GitHub
parent bd7503d506
commit aea123842b
11 changed files with 4 additions and 144 deletions

View File

@@ -64,7 +64,7 @@ func GetMergedConfig(args cmdarg.Arg) (string, error) {
var files []*ConfigSource
supported := []string{"json", "yaml", "toml"}
for _, file := range args {
format := getFormat(file)
format := GetFormat(file)
if slices.Contains(supported, format) {
files = append(files, &ConfigSource{
Name: file,
@@ -98,7 +98,7 @@ func getExtension(filename string) string {
return filename[idx+1:]
}
func getFormat(filename string) string {
func GetFormat(filename string) string {
return GetFormatByExtension(getExtension(filename))
}
@@ -112,7 +112,7 @@ func LoadConfig(formatName string, input interface{}) (*Config, error) {
if formatName == "auto" {
if file != "stdin:" {
f = getFormat(file)
f = GetFormat(file)
} else {
f = "json"
}