Annotation of templates/template.py, revision 1.4
1.1 nick 1: #!/usr/bin/python
1.4 ! nick 2: # -*- coding: utf-8 -*-
1.1 nick 3:
1.2 nick 4: """
5: +------------------------------------------------------------------------------
6: |
7: | Copyright Nicholas DeClario 2013
8: | Nicholas DeClario <nick@demandred.dyndns.org>
9: | March 2013
1.4 ! nick 10: | $Id: template.py,v 1.3 2013/09/30 20:38:03 nick Exp $
1.2 nick 11: |
12: +------------------------------------------------------------------------------
1.1 nick 13:
1.2 nick 14: """
15: import os
16: import sys
17: import argparse
1.1 nick 18:
1.2 nick 19: """
20: fetchOptions()
1.1 nick 21:
1.2 nick 22: Grab our command line arguments and toss them in to a hash
23: """
1.1 nick 24:
25:
1.2 nick 26: def fetchOptions():
1.3 nick 27: parse = argparse.ArgumentParser()
1.2 nick 28: parse.add_argument('-m', '--man', help='Display the man page', \
29: dest='man', default=False, action='store_true')
30: parse.add_argument('-t', '--test', help='Test Argument', dest='test')
1.1 nick 31:
1.2 nick 32: return parse.parse_args()
33:
34: """
35: The magic starts here
36: """
37:
38:
39: def main():
40:
41: if opts.man:
42: displayMan()
43:
44:
45: if __name__ == '__main__':
46: opts = fetchOptions()
47: main()
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>