[pybliographer] Remove the -v options of pybformat, and some cosmetics.



commit 81013911a3a8cfd0e704a4b94a54fad10add5333
Author: Zoltan Kota <zoltank gmail com>
Date:   Tue Sep 7 14:41:28 2010 +0200

    Remove the -v options of pybformat, and some cosmetics.
    
    The -v option does the same as -h, shows the help info.
    This message might be disturbing, and none of the scripts
    shows any version info anyway. So, let's remove it.
    Better error handling of options is also added.

 scripts/pybformat.py |   17 +++++++----------
 1 files changed, 7 insertions(+), 10 deletions(-)
---
diff --git a/scripts/pybformat.py b/scripts/pybformat.py
index 00e157e..222b27a 100644
--- a/scripts/pybformat.py
+++ b/scripts/pybformat.py
@@ -41,7 +41,6 @@ def usage ():
       -F footer, --footer=footer	defines a footer file
       -l 'output', --list='output'	lists the available output formats
       -h, --help			show this help message
-      -v, --version			show this help message
     """).encode (charset)
     return
 
@@ -57,16 +56,20 @@ def warning (text, exit = 0):
         sys.exit (1)
     return
 
-optlist, args = getopt.getopt (sys.argv [2:],
-			       'H:F:o:l:vhs:f:',
+try:
+    optlist, args = getopt.getopt (sys.argv [2:],
+			       'H:F:o:l:hs:f:',
 			       ['header=',
 				'footer=',
                                 'output=',
                                 'list=',
                                 'style=',
                                 'format=',
-				'version',
 				'help'])
+except getopt.GetoptError, err:
+    usage ()
+    error (str(err).decode (charset))
+
 
 header  = None
 footer  = None
@@ -119,12 +122,6 @@ for opt, value in optlist:
         continue
     
 
-    if opt == '-v' or opt == '--version':
-        usage ()
-        sys.exit (0)
-        continue
-
-
 # test input arguments
 if len (args) < 1:
     # user gave wrong arguments...



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]