]> gitweb.michael.orlitzky.com - dead/census-tools.git/blobdiff - bin/drag_wkt_along_kml_path
Modified the default_option_parser function to return a parser using a VerbatimHelpFo...
[dead/census-tools.git] / bin / drag_wkt_along_kml_path
index 072d72a768fec0747fa6e13bb8b88efcd5a084c3..aa274661023ba6a56386094a518ee020071dacf9 100755 (executable)
@@ -11,13 +11,12 @@ import pgdb
 import os
 import site
 import sys
-from optparse import OptionParser
 
-# Basically, add '../src' and '../lib/Shapely' to our path.
+# Basically, add '../src' to our path.
 # Needed for the imports that follow.
 site.addsitedir(os.path.dirname(os.path.abspath(sys.argv[0])) + '/../src')
-site.addsitedir(os.path.dirname(os.path.abspath(sys.argv[0])) + '/../lib/Shapely')
 
+import CLI
 import Configuration.Defaults
 import ExitCodes
 import Geometry
@@ -26,25 +25,10 @@ import KML
 usage = '%prog [options] <well-known text> <kml filename>'
 
 # -h (help) Conflicts with -h HOSTNAME
-parser = OptionParser(usage=usage, add_help_option = False)
+parser = CLI.default_option_parser(usage)
 
 # Use this module's docstring as the description.
-parser.description = __doc__.strip()
-
-parser.add_option('-h',
-                  '--host',
-                  help='The hostname/address where the database is located.',
-                  default=Configuration.Defaults.DATABASE_HOST)
-
-parser.add_option('-d',
-                  '--database',
-                  help='The database in which the population data are stored.',
-                  default=Configuration.Defaults.DATABASE_NAME)
-
-parser.add_option('-U',
-                  '--username',
-                  help='The username who has access to the database.',
-                  default=Configuration.Defaults.DATABASE_USERNAME)
+parser.description = __doc__
 
 parser.add_option('-o',
                   '--outfile',