Fix --quiet/--verbose option handling
authorMichael Prokop <mika@grml.org>
Tue, 24 Mar 2009 21:33:33 +0000 (22:33 +0100)
committerMichael Prokop <mika@grml.org>
Tue, 24 Mar 2009 21:33:33 +0000 (22:33 +0100)
debian/changelog
grml2usb

index 7f1b308..f641b58 100644 (file)
@@ -15,8 +15,11 @@ grml2usb (0.9.3) UNRELEASED; urgency=low
     (Thanks to Ralf Gross for the report and relevant information.)
   * Also add specified bootoptions to default entry in configuration
     file of grub version 1. (Thanks to Ralf Gross for the bugreport.)
     (Thanks to Ralf Gross for the report and relevant information.)
   * Also add specified bootoptions to default entry in configuration
     file of grub version 1. (Thanks to Ralf Gross for the bugreport.)
+  * Make sure that options "--quiet" and "--verbose" aren't accepted
+    at the same time in the command line. Thanks for bugreport and
+    code example, Karl Voit!
 
 
- -- Michael Prokop <mika@grml.org>  Tue, 24 Mar 2009 17:45:45 +0100
+ -- Michael Prokop <mika@grml.org>  Tue, 24 Mar 2009 22:32:05 +0100
 
 grml2usb (0.9.2) unstable; urgency=low
 
 
 grml2usb (0.9.2) unstable; urgency=low
 
index bc58eac..06c3c9c 100755 (executable)
--- a/grml2usb
+++ b/grml2usb
@@ -1562,6 +1562,9 @@ def handle_compat_warning(device):
 def handle_logging():
     """Log handling and configuration"""
 
 def handle_logging():
     """Log handling and configuration"""
 
+    if options.verbose and options.quiet:
+        parser.error("please use either verbose (--verbose) or quiet (--quiet) option")
+
     if options.verbose:
         FORMAT = "Debug: %(asctime)-15s %(message)s"
         logging.basicConfig(level=logging.DEBUG, format=FORMAT)
     if options.verbose:
         FORMAT = "Debug: %(asctime)-15s %(message)s"
         logging.basicConfig(level=logging.DEBUG, format=FORMAT)