X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=bin%2Flines2kml;h=0e239424046d90c275133faec3e09f1a1b48a01f;hb=3a1235a834118bb52c5d92fce9c7182c04a44e0b;hp=bba63b2f59df68e25e71826b502a29fd900bab50;hpb=5a969daed7f14f10a3a80b823be5a108696399b7;p=dead%2Fcensus-tools.git diff --git a/bin/lines2kml b/bin/lines2kml index bba63b2..0e23942 100755 --- a/bin/lines2kml +++ b/bin/lines2kml @@ -6,7 +6,6 @@ Language (KML). The exported roads should have both a human-readable name and a globally-unique identifier (gid). """ -from optparse import OptionParser import os import pgdb import site @@ -16,6 +15,7 @@ import sys # Needed for the imports that follow. site.addsitedir(os.path.dirname(os.path.abspath(sys.argv[0])) + '/../src') +import CLI import Configuration.Defaults import ExitCodes import KML @@ -26,26 +26,11 @@ Parse the command line options. All of these are optional; defaults are provided for the database information and the output is written to stdout. """ -# -h (help) Conflicts with -h HOSTNAME -parser = OptionParser(add_help_option = False) + +parser = CLI.default_option_parser() # 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('-s', '--state',