Skip to content

Task arguments

Idan Arye edited this page Mar 25, 2019 · 2 revisions

The first argument of the task is the context. Any argument after that (except special arguments) are mapped from the Vim command used to invoke the task:

@task
def greet(ctx, name, city):
    print('Hello %s, how is it in %s?' % (name, city))
OP greet John Washington

Simply enough, this will print "Hello John, how is it in Washington?"

Note that all arguments are strings, and they are separated by spaces. If you need an argument with multiple works, use backslash to escape it:

OP greet John\ Smith New\ York

Quoting the arguments will not work (Vim's argument handling do not support it)

Clone this wiki locally