Donovan Donovan - 1 year ago 135
Python Question

Pass parameter to fabric task

How can I pass a parameter to a fabric task when calling "fab" from the command line? For example:

def task(something=''):
print "You said %s" % something

$ fab task "hello"
You said hello


Is it possible to do this without prompting with

Answer Source

Fabric uses the following syntax for passing arguments to tasks:

 fab task:'hello world'
 fab task:something='hello'
 fab task:foo=99,bar=True
 fab task:foo,bar

You can read more about it in Fabric docs.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download