X-Git-Url: http://gitweb.michael.orlitzky.com/?p=dead%2Fcensus-tools.git;a=blobdiff_plain;f=bin%2Fwkt2pop;h=3fa70b220f76569765cedca4391a36b0dac0e5ff;hp=6b6290e9d9f8232af971541826cda022fbd400ed;hb=d67b2e640133c45a31813ec853e58a866553134a;hpb=34556a43e5ba2725e00ce097dd2a1cfd3bf21e9e diff --git a/bin/wkt2pop b/bin/wkt2pop index 6b6290e..3fa70b2 100755 --- a/bin/wkt2pop +++ b/bin/wkt2pop @@ -16,38 +16,22 @@ string. import sys import os import site -from optparse import OptionParser # Basically, add '../src' to our path. # Needed for the imports that follow. site.addsitedir(os.path.dirname(os.path.abspath(sys.argv[0])) + '/../src') import Census +import CLI import Configuration.Defaults import ExitCodes usage = '%prog [options] ' - -# -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.add_option('-s', '--srid', @@ -77,4 +61,3 @@ if (population != None): else: print 'Error: No rows returned.' raise SystemExit(ExitCodes.NO_RESULTS) -