Created
September 24, 2014 09:43
-
-
Save stestagg/d250a1e8cef1060d4aa4 to your computer and use it in GitHub Desktop.
Template for shell script boilerplate
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import sys | |
import argparse | |
def parse_args(args=None): | |
parser = argparse.ArgumentParser() | |
parser.add_argument("-v", "--verbose", action="count", default=0, | |
help="Increase verbosity", dest="verbosity") | |
return parser.parse_args() | |
def main(args=None): | |
arguments = parse_args(args) | |
print "Verbosity: %i" % arguments.verbosity | |
if __name__ == "__main__": | |
sys.exit(main()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment