Explorar o código

Preload options now supports ["--opt", "value"]. Closes #1668

Ask Solem %!s(int64=11) %!d(string=hai) anos
pai
achega
733a3b2d56
Modificáronse 1 ficheiros con 6 adicións e 1 borrados
  1. 6 1
      celery/bin/base.py

+ 6 - 1
celery/bin/base.py

@@ -481,7 +481,12 @@ class Command(object):
                         acc[opt.dest] = value
                 else:
                     opt = opts.get(arg)
-                    if opt and opt.action == 'store_true':
+                    if opt.takes_value():
+                        # optparse also supports ['--opt', 'value']
+                        # (Issue #1668)
+                        acc[opt.dest] = args[index + 1]
+                        index += 1
+                    elif opt and opt.action == 'store_true':
                         acc[opt.dest] = True
             elif arg.startswith('-'):
                 opt = opts.get(arg)