Impossible to create an instance without installing it
authorFrederic Massart <fred@moodle.com>
Tue, 12 Nov 2013 01:26:07 +0000 (09:26 +0800)
committerFrederic Massart <fred@moodle.com>
Tue, 12 Nov 2013 01:26:07 +0000 (09:26 +0800)
lib/commands/create.py

index 7e41345..ec668fd 100644 (file)
@@ -111,8 +111,13 @@ class CreateCommand(Command):
         suffixes = args.suffix
         install = args.install
 
-        if engine and not install:
-            self.argumentError('--engine can only be used with --install.')
+        # Throw an error when --engine is used without --install. The code is currently commented out
+        # because as --engine has a default value, it will always be set, and so it becomes impossible
+        # to create an instance without installing it. I cannot think about a clean fix yet. Removing
+        # the default value will cause --help not to output the default as it should... Let's put more
+        # thoughts into this and perhaps use argument groups.
+        # if engine and not install:
+            # self.argumentError('--engine can only be used with --install.')
 
         for version in versions:
             for suffix in suffixes: