]> gitweb.michael.orlitzky.com - dead/census-tools.git/blobdiff - bin/wkt2pop
Moved the line-height definition into the body element.
[dead/census-tools.git] / bin / wkt2pop
index 6b6290e9d9f8232af971541826cda022fbd400ed..89bb5955b480d69a4a5592cc36c99f0084d1f261 100755 (executable)
@@ -2,9 +2,7 @@
 
 """
 Find the total population contained within a geometric object.
-"""
 
-"""
 Our input is an OGC Well-Known Text[1] string. This string is used as
 part of a database query that finds the population contained within
 (i.e. 'underneath') the geometric object corresponding to the WKT
@@ -16,38 +14,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] <well-known text representation>'
-
-# -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.description = __doc__
 
-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 +59,3 @@ if (population != None):
 else:
     print 'Error: No rows returned.'
     raise SystemExit(ExitCodes.NO_RESULTS)
-