From: Elena Balakhonova Date: Tue, 3 Dec 2019 13:12:11 +0000 (+0300) Subject: Convenient -passwd-check option X-Git-Tag: v2.0.0~23 X-Git-Url: http://www.git.cypherpunks.ru/?p=gocheese.git;a=commitdiff_plain;h=5ccea4614d3d499a0b183998230778e4adfc6127 Convenient -passwd-check option --- diff --git a/gocheese.go b/gocheese.go index 1d8d0b5..6ca3ad5 100644 --- a/gocheese.go +++ b/gocheese.go @@ -65,6 +65,7 @@ var ( refreshURLPath = flag.String("refresh", "/simple/", "Auto-refreshing URL path") pypiURL = flag.String("pypi", "https://pypi.org/simple/", "Upstream PyPI URL") passwdPath = flag.String("passwd", "passwd", "Path to file with authenticators") + passwdCheck = flag.Bool("passwd-check", false, "Test the -passwd file for syntax errors and exit") fsck = flag.Bool("fsck", false, "Check integrity of all packages") version = flag.Bool("version", false, "Print version information") warranty = flag.Bool("warranty", false, "Print warranty information") @@ -455,6 +456,10 @@ func main() { } return } + if *passwdCheck { + refreshPasswd() + return + } refreshPasswd() log.Println("root:", *root, "bind:", *bind) http.HandleFunc(*norefreshURLPath, handler)