#!/usr/bin/env python

from ctlookup import lookup
import argparse

# Parse command line argument
parser = argparse.ArgumentParser(description='Lookup the official name of unofficial Connecticut town names.')
parser.add_argument('town_name',help="the town name to look up")
parser.add_argument('-e','--error',default=None,help="the value returned when a proper name cannot be found (default: None)")
p = parser.parse_args()

# Create a ct lookup object
l = lookup.Lookup()

# Lookup and return the value
print l.clean(p.town_name,error=p.error)
