From d8c95aaca8fafef6afe7b0e35df40d48edc1b4b7 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Fri, 6 Apr 2018 03:01:42 +0200 Subject: [PATCH] Add a -v flag Fixes #317 But makes me grumpy, because -v usually means `verbose` to me. --- dnscrypt-proxy/config.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dnscrypt-proxy/config.go b/dnscrypt-proxy/config.go index 505dcb26..1bb536cf 100644 --- a/dnscrypt-proxy/config.go +++ b/dnscrypt-proxy/config.go @@ -153,7 +153,8 @@ func findConfigFile(configFile *string) (string, error) { } func ConfigLoad(proxy *Proxy, svcFlag *string) error { - version := flag.Bool("version", false, "print current proxy version") + version_short := flag.Bool("v", false, "print current proxy version") + version := flag.Bool("version", false, "alias for -v") resolve := flag.String("resolve", "", "resolve a name using system libraries") list := flag.Bool("list", false, "print the list of available resolvers for the enabled filters") listAll := flag.Bool("list-all", false, "print the complete list of available resolvers, ignoring filters") @@ -166,7 +167,7 @@ func ConfigLoad(proxy *Proxy, svcFlag *string) error { if *svcFlag == "stop" || *svcFlag == "uninstall" { return nil } - if *version { + if *version || *version_short { fmt.Println(AppVersion) os.Exit(0) }