From: Joerg Jaspert Date: Fri, 13 Mar 2009 22:49:46 +0000 (+0100) Subject: And do the cmd parsing before we set log stuff X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=92ce89167ca9636f1b96fdd626c34aa0f525433d;p=dak And do the cmd parsing before we set log stuff Signed-off-by: Joerg Jaspert --- diff --git a/dak/contents.py b/dak/contents.py index c0713c75..1efb361f 100755 --- a/dak/contents.py +++ b/dak/contents.py @@ -377,6 +377,14 @@ def main(): 'cruft' : Contents.cruft, } + args = apt_pkg.ParseCommandLine(cnf.Cnf, arguments,sys.argv) + + if (len(args) < 1) or not commands.has_key(args[0]): + usage() + + if cnf.has_key("%s::%s" % (options_prefix,"Help")): + usage() + level=logging.INFO if cnf.has_key("%s::%s" % (options_prefix,"Quiet")): level=logging.ERROR @@ -389,14 +397,6 @@ def main(): format='%(asctime)s %(levelname)s %(message)s', stream = sys.stderr ) - args = apt_pkg.ParseCommandLine(cnf.Cnf, arguments,sys.argv) - - if (len(args) < 1) or not commands.has_key(args[0]): - usage() - - if cnf.has_key("%s::%s" % (options_prefix,"Help")): - usage() - commands[args[0]](Contents()) if __name__ == '__main__':