diff makeitso/cli.py @ 85:cb6c54b1adf3

allow .parse() to be consumed
author Jeff Hammel <jhammel@mozilla.com>
date Mon, 10 Jan 2011 12:35:37 -0800
parents 059b02808efa
children e74baa8e6df4
line wrap: on
line diff
--- a/makeitso/cli.py	Sun Jan 09 11:20:16 2011 -0800
+++ b/makeitso/cli.py	Mon Jan 10 12:35:37 2011 -0800
@@ -29,9 +29,12 @@
                         help=description)
     return parser
 
-  def parse(self):
-    parser = self.parser()
-    options, args = parser.parse_args()
+  def parse(self, parser=None, options=None, args=None):
+
+    # parse the command line
+    if not parser or not options or not args:
+      parser = self.parser()
+      options, args = parser.parse_args()
 
     # ensure output is given
     if len(args) != 1: