From f1a728b334644bd3695ee6f9e3c3f92b87ec4ffa Mon Sep 17 00:00:00 2001 From: Walter Bender Date: Wed, 09 Jun 2010 01:55:24 +0000 Subject: cleaned up syntax for cmdline parsing as per jbistures-clone --- (limited to 'turtleart.py') diff --git a/turtleart.py b/turtleart.py index 4978e0c..9472c82 100755 --- a/turtleart.py +++ b/turtleart.py @@ -55,21 +55,23 @@ class TurtleMain(): # Parse command line try: - opts, args = getopt.getopt(sys.argv[1:], "hot:v", ["taproject=", + opts, args = getopt.getopt(sys.argv[1:], "hot:v", ["taproject", "help", "output_png"]) except getopt.GetoptError, err: print str(err) print HELP_MSG sys.exit(2) - for o, a in opts: if o in ('-o', '--output_png'): self.output_png = True + self.ta_file = args[0] elif o in ('-h', '--help'): print HELP_MSG sys.exit() - elif o in ('-t', 'taproject'): + elif o in ('-t'): self.ta_file = a + elif o in ('--taproject'): + self.ta_file = args[0] else: assert False, 'unhandled option' -- cgit v0.9.1