Skip to content

Instantly share code, notes, and snippets.

@callmephilip
Created August 24, 2012 00:09
Show Gist options
  • Save callmephilip/3443827 to your computer and use it in GitHub Desktop.
Save callmephilip/3443827 to your computer and use it in GitHub Desktop.
[Python Fabric] passing arguments to a task
def new_user(username, admin='no', comment="No comment provided"):
log_action("New User (%s): %s" % (username, comment))
pass
$ fab new_user:myusername
$ fab new_user:username=myusername
$ fab new_user:myusername,yes
$ fab new_user:myusername,admin=yes
$ fab new_user:myusername,admin=no,comment='Gary\, new developer (starts Monday)'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment