Browse Source

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

Ask Solem 11 years ago
parent
commit
733a3b2d56
1 changed files with 6 additions and 1 deletions
  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)