#!/usr/bin/python import argparse from sys import exit parser = argparse.ArgumentParser(description="Simple Program to Print Things About Goats") parser.add_argument("-n", metavar="number", help="Number of Goat Facts to Print", default=1) parser.add_argument("-v", help="Print program version", action="store_true"); parser.add_argument("-d", help="Print each printed fact twice", action="store_true"); options = parser.parse_args() if options.v: print "Version 1.0" exit() facts = ["Goats have 4 legs", "One of my goats has a digestive problem and needs antibiotics twice a day", "Goats like to worm through fences and sometimes get their heads stuck"] max_facts = int(options.n) for fact in facts[:max_facts]: print fact if(options.d): print fact