Skip to content

Instantly share code, notes, and snippets.

@mostafahussein
Forked from callmephilip/gist:3443827
Created March 8, 2016 13:52
Show Gist options
  • Save mostafahussein/aa6e2968d8ff86ea77c7 to your computer and use it in GitHub Desktop.
Save mostafahussein/aa6e2968d8ff86ea77c7 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