# python.snippets
# vim: set ts=8 sw=8 sts=8 noet list:
# Eryn Wells <eryn@erynwells.me>

snippet parse_args
def parse_args():
	parser = argparse.ArgumentParser()
	# TODO: Configure arguments here.
	args = parser.parse_args()
	return args
endsnippet

snippet ifmain
def main(argv):
	${1:pass}


if __name__ == '__main__':
	import sys
	sys.exit(main(sys.argv))
endsnippet

snippet script
#!/usr/bin/env python3
# Eryn Wells <eryn@erynwells.me>

'''
New script.
'''

import argparse


def parse_args(argv, *a, **kw):
	parser = argparse.ArgumentParser(*a, **kw)
	# TODO: Configure arguments here.
	args = parser.parse_args(argv)
	return args


def main(argv):
	args = parse_args(argv[1:], prog=argv[0])
	${1:# TODO}


if __name__ == '__main__':
	import sys
	sys.exit(main(sys.argv))
endsnippet
