Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/turtleart.py
diff options
context:
space:
mode:
authorWalter Bender <walter@sugarlabs.org>2010-06-09 01:55:24 (GMT)
committer Walter Bender <walter@sugarlabs.org>2010-06-09 01:55:24 (GMT)
commitf1a728b334644bd3695ee6f9e3c3f92b87ec4ffa (patch)
treeccfab3d26ca79f7cbfdab3d0f0c6b8dfccb414f8 /turtleart.py
parent146b3de0994d0308d1f36440fa84b4dfc58bd4a2 (diff)
cleaned up syntax for cmdline parsing as per jbistures-clone
Diffstat (limited to 'turtleart.py')
-rwxr-xr-xturtleart.py8
1 files changed, 5 insertions, 3 deletions
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'