]> Cypherpunks.ru repositories - gocheese.git/commitdiff
Convenient -passwd-check option
authorElena Balakhonova <balakhonova@rnd.stcnet.ru>
Tue, 3 Dec 2019 13:12:11 +0000 (16:12 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Tue, 3 Dec 2019 13:38:27 +0000 (16:38 +0300)
gocheese.go

index 1d8d0b5425b6541b2f9906ef822e7a856c9288fb..6ca3ad53e036236ea7dc3310e74d55641f715bbb 100644 (file)
@@ -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)