From 92ce89167ca9636f1b96fdd626c34aa0f525433d Mon Sep 17 00:00:00 2001 From: Joerg Jaspert Date: Fri, 13 Mar 2009 23:49:46 +0100 Subject: [PATCH] And do the cmd parsing before we set log stuff Signed-off-by: Joerg Jaspert --- dak/contents.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) 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__': -- 2.39.5