Merge: + --version: Show the version and exit

Close #1285

Squashed commit of the following:

commit fdc616f38651f9fcc16442003bd15adb88e2c2b1
Author: Simon Zolin <s.zolin@adguard.com>
Date:   Wed Jan 15 18:46:00 2020 +0300

    minor

commit 6f5a22c86e5fe76c3959343a8077d3997ff0707d
Author: Simon Zolin <s.zolin@adguard.com>
Date:   Mon Dec 30 19:19:30 2019 +0300

    + --version: Show the version and exit
This commit is contained in:
Simon Zolin 2020-01-16 10:42:03 +03:00
parent eb6c4eb132
commit 5773df6f6c

View file

@ -473,6 +473,10 @@ func loadOptions() options {
{"check-config", "", "Check configuration and exit", nil, func() { o.checkConfig = true }},
{"no-check-update", "", "Don't check for updates", nil, func() { o.disableUpdate = true }},
{"verbose", "v", "Enable verbose output", nil, func() { o.verbose = true }},
{"version", "", "Show the version and exit", nil, func() {
fmt.Printf("AdGuardHome %s\n", versionString)
os.Exit(0)
}},
{"help", "", "Print this help", nil, func() {
printHelp()
os.Exit(64)