Make python display help screen if no action is given
- by luckytaxi
Let's say a user runs the script w/o giving any paramters. How can I make it so that it defaults to ./myscript.py -h so that it shows them the help info?
parser = optparse.OptionParser()
parser.add_option("-d", "--directory", metavar="DIR",
help="Directory to scan for big files")
parser.add_option("-e", "--email", metavar='EMAIL',
help='email to send the list to')
parser.add_option("-l", "--limit", metavar='LIMIT',
help='return number of files')