diff --git a/proxy/debug.go b/proxy/debug.go index 90fe8ec..9db4400 100644 --- a/proxy/debug.go +++ b/proxy/debug.go @@ -1,7 +1,10 @@ package proxy import ( + "errors" "fmt" + "os" + "path/filepath" "strings" "github.com/Baipyrus/ProxySwitcher/util" @@ -20,13 +23,21 @@ func mapCmdsToStr(commands []*util.Command) string { } func Debug(cfgFile string) { + path, _ := filepath.Abs(cfgFile) + if _, err := os.Stat(path); errors.Is(err, os.ErrNotExist) { + path = "[N/A]" + } + + fmt.Printf("\nConfig:\n") + fmt.Printf("%s\n\n", path) + proxy, _ := ReadSystemProxy() proxyServer := proxy.Server if proxyServer == "" { proxyServer = "[N/A]" } - fmt.Println("\nSystem Proxy:") + fmt.Println("System Proxy:") fmt.Printf("Enabled: %t\n", proxy.Enabled) fmt.Printf("Server: %s\n\n", proxyServer)