X-Git-Url: http://gitweb.michael.orlitzky.com/?p=dead%2Fcensus-tools.git;a=blobdiff_plain;f=bin%2Fwkt2kml;h=81b45ffc3fd924361cbf99ab6b87596dffb750de;hp=598fb52f8d930ace785ced75361bfb2fe65e0bf2;hb=d67b2e640133c45a31813ec853e58a866553134a;hpb=34556a43e5ba2725e00ce097dd2a1cfd3bf21e9e diff --git a/bin/wkt2kml b/bin/wkt2kml index 598fb52..81b45ff 100755 --- a/bin/wkt2kml +++ b/bin/wkt2kml @@ -18,7 +18,6 @@ conversions correctly, sans-database. [2] http://search.cpan.org/dist/Geo-Converter-WKT2KML/ """ -from optparse import OptionParser import os import pgdb import site @@ -28,6 +27,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 GPS @@ -45,27 +45,11 @@ default. The name option is available in case the user would like to e.g. see the object name in Google Earth. """ -# -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.add_option('-o', '--outfile', help='Optional output file path. Defaults to stdout.')