Skip to content

Instantly share code, notes, and snippets.

@stestagg
Created September 24, 2014 09:43
Show Gist options
  • Save stestagg/d250a1e8cef1060d4aa4 to your computer and use it in GitHub Desktop.
Save stestagg/d250a1e8cef1060d4aa4 to your computer and use it in GitHub Desktop.
Template for shell script boilerplate
#!/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