]> err.no Git - dak/commitdiff
And do the cmd parsing before we set log stuff
authorJoerg Jaspert <joerg@debian.org>
Fri, 13 Mar 2009 22:49:46 +0000 (23:49 +0100)
committerJoerg Jaspert <joerg@debian.org>
Fri, 13 Mar 2009 22:49:46 +0000 (23:49 +0100)
Signed-off-by: Joerg Jaspert <joerg@debian.org>
dak/contents.py

index c0713c75fdfb422b6a37795fb5717cc2b64afde0..1efb361fac74981f288d8aaf6f3bb34cc198207e 100755 (executable)
@@ -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__':