From: Joerg Jaspert Date: Fri, 21 Mar 2008 20:49:03 +0000 (+0100) Subject: Check for help option before we do any database connect or sudo checks/prints X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=deb5f3b36f681b5e5e9dafe68bdad3a0a8390fb9;p=dak Check for help option before we do any database connect or sudo checks/prints --- diff --git a/dak/transitions.py b/dak/transitions.py index 3cac07af..23752718 100755 --- a/dak/transitions.py +++ b/dak/transitions.py @@ -58,6 +58,9 @@ def init(): Options = Cnf.SubTree("Edit-Transitions::Options") + if Options["help"]: + usage() + whoami = os.getuid() whoamifull = pwd.getpwuid(whoami) username = whoamifull[0] @@ -68,9 +71,6 @@ def init(): projectB = pg.connect(Cnf["DB::Name"], Cnf["DB::Host"], int(Cnf["DB::Port"])) daklib.database.init(Cnf, projectB) - if Options["help"]: - usage() - ################################################################################ def usage (exit_code=0):