Browse Source

Commands: shell should raise error for positionl args present

Ask Solem 8 năm trước cách đây
mục cha
commit
1a4c334df1
1 tập tin đã thay đổi với 7 bổ sung1 xóa
  1. 7 1
      celery/bin/celery.py

+ 7 - 1
celery/bin/celery.py

@@ -838,7 +838,13 @@ class shell(Command):  # pragma: no cover
         Option('--gevent', action='store_true', help='use gevent.'),
     )
 
-    def run(self, ipython=False, bpython=False,
+    def run(self, *args, **kwargs):
+        if args:
+            raise self.UsageError(
+                'shell command does not take arguments: {0}'.format(args))
+        return self._run(**kwargs)
+
+    def _run(self, ipython=False, bpython=False,
             python=False, without_tasks=False, eventlet=False,
             gevent=False, **kwargs):
         sys.path.insert(0, os.getcwd())