#!/usr/bin/env python
import argparse
#Currently only supporting BrE
from viadict import dictionary, thesaurus

parser = argparse.ArgumentParser(description='Find a word\'s definition')
parser.add_argument('words', metavar='WORD', type=str, nargs='+',
                   help='The word to search for in reference material')
parser.add_argument('-t', '--thesaurus', dest='fn', action='store_const',
                   const=thesaurus, default=dictionary,
                   help='''Find synonyms with the system thesaurus''')

args = parser.parse_args()
for word in args.words:
  print args.fn(word)
