Add parameter handling
authorduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Tue, 7 Apr 2009 08:23:53 +0000 (08:23 +0000)
committerduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Tue, 7 Apr 2009 08:23:53 +0000 (08:23 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2471 38d2e660-2303-0410-9eaa-f027e97ec537

wizard/bertos.py

index a92a054bc289a42b7653f66a2a453c1f0d844585..a6529abef39c70b16d644342f0ce253c1ae6a33d 100755 (executable)
@@ -58,8 +58,18 @@ def main():
     if newer("bertos.qrc", "bertos.rcc"):
         os.system("rcc -binary bertos.qrc -o bertos.rcc")
     QResource.registerResource("bertos.rcc")
-    showStartPage()
-    sys.exit(app.exec_())
+    if "--create" in sys.argv and "--edit" not in sys.argv:
+        newProject()
+    elif "--edit" in sys.argv and "--create" not in sys.argv:
+        editProject()
+    elif "--create" in sys.argv and "--edit" in sys.argv:
+        ## TODO: need an explaining message
+        print " ".join(sys.argv)
+        print "Invalid usage!"
+        pass
+    else:
+        showStartPage()
+        sys.exit(app.exec_())
 
 if __name__ == '__main__':
     main()