- Timestamp:
- 02/02/08 11:49:37 (17 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/pykota/commandline/parser.py
r3305 r3312 22 22 """This modules defines a command line options parser for PyKota's command line tools.""" 23 23 24 import sys 25 import os 24 26 import optparse 25 27 from gettext import gettext as _ … … 89 91 """Adds an usage example.""" 90 92 self.examples.append(("%prog " + command, doc)) 93 94 def parse_args(self, args=None, values=None) : 95 """Parses command line arguments, and handles -v|--version as well.""" 96 (options, arguments) = optparse.OptionParser.parse_args(self, args, values) 97 if options.version : 98 sys.stdout.write("%s (PyKota) %s\n" % (os.path.basename(sys.argv[0]), 99 version.__version__)) 100 sys.exit(0) 101 return (options, arguments)