Skip to content
Browse files

Pass arguments through to warp commands, if given

  • Loading branch information...
1 parent 094f860 commit 06ebc97424447e5967d6c5e7ac10f95b2387184e @brendonh committed Jun 17, 2014
Showing with 8 additions and 5 deletions.
  1. +8 −5 twisted/plugins/warp_plugin.py
View
13 twisted/plugins/warp_plugin.py
@@ -29,10 +29,11 @@ def parseArgs(self, name, model):
self['name'] = name
self['model'] = model
-
class CommandOptions(usage.Options):
- def parseArgs(self, fqn):
+ def parseArgs(self, fqn, *args):
self['fqn'] = fqn
+ self['args'] = args
+
class Options(usage.Options):
optParameters = (
@@ -114,12 +115,14 @@ def makeService(self, options):
c = code.InteractiveConsole(locals)
c.interact()
raise SystemExit
-
+
if options.subCommand == 'command':
obj = reflect.namedObject(options.subOptions['fqn'])
- obj()
+ if options.subOptions['args']:
+ obj(*options.subOptions['args'])
+ else:
+ obj()
raise SystemExit
-
if config.get('ssl'):
from warp.webserver import sslcontext

0 comments on commit 06ebc97

Please sign in to comment.
Something went wrong with that request. Please try again.