Changeset 3315

Show
Ignore:
Timestamp:
02/02/08 13:38:02 (16 years ago)
Author:
jerome
Message:

Added a specific method to add all generic options.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/pykota/commandline.py

    r3314 r3315  
    4141        optparse.OptionParser.__init__(self, *args, **kwargs) 
    4242        self.disable_interspersed_args() 
    43         self.add_option("-v", "--version", 
    44                               action="store_true", 
    45                               dest="version", 
    46                               help=_("show %prog's version number and exit.")) 
     43        self.add_generic_options() 
    4744         
    4845    def format_help(self, formatter=None) : 
     
    10198        self.examples.append(("%prog " + command, doc)) 
    10299         
     100    def add_generic_options(self) :     
     101        """Adds options which are common to all PyKota command line tools.""" 
     102        self.add_option("-v", "--version", 
     103                              action="store_true", 
     104                              dest="version", 
     105                              help=_("show the version number and exit")) 
     106         
    103107    def handle_generic_options(self, options) :     
    104108        """Handles options which are common to all PyKota command line tools."""