]> arthur.barton.de Git - bup.git/blobdiff - lib/bup/options.py
Fix formatting of usage message (especially newlines)
[bup.git] / lib / bup / options.py
index b1284e90392d48d3a73a02f1fd364a288bce05cb..65702e2a80c8629d530ea5e1d41938e0195a9f23 100644 (file)
@@ -3,19 +3,19 @@
 #
 # (This license applies to this file but not necessarily the other files in
 # this package.)
-# 
+#
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions are
 # met:
-# 
+#
 #    1. Redistributions of source code must retain the above copyright
 #       notice, this list of conditions and the following disclaimer.
-# 
+#
 #    2. Redistributions in binary form must reproduce the above copyright
 #       notice, this list of conditions and the following disclaimer in
 #       the documentation and/or other materials provided with the
 #       distribution.
-# 
+#
 # THIS SOFTWARE IS PROVIDED BY AVERY PENNARUN ``AS IS'' AND ANY
 # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
@@ -45,10 +45,11 @@ longer one, but the short one can be omitted.
 Long option flags are used as the option's key for the OptDict produced when
 parsing options.
 
-When the flag definition is ended with an equal sign, the option takes one
-string as an argument. Otherwise, the option does not take an argument and
-corresponds to a boolean flag that is true when the option is given on the
-command line.
+When the flag definition is ended with an equal sign, the option takes
+one string as an argument, and that string will be converted to an
+integer when possible. Otherwise, the option does not take an argument
+and corresponds to a boolean flag that is true when the option is
+given on the command line.
 
 The option's description is found at the right of its flags definition, after
 one or more spaces. The description ends at the end of the line. If the
@@ -227,14 +228,14 @@ class Options:
         """Print usage string to stderr and abort."""
         sys.stderr.write(self._usagestr)
         if msg:
-            sys.stderr.write(msg)
+            sys.stderr.write("\n" + msg)
         e = self._onabort and self._onabort(msg) or None
         if e:
             raise e
 
     def fatal(self, msg):
         """Print an error message to stderr and abort with usage string."""
-        msg = '\nerror: %s\n' % msg
+        msg = 'Error: %s!' % msg
         return self.usage(msg)
 
     def parse(self, args):