paver/paver — pull request #68 by fero14041 (2012-07-21 16:13:03+00:00)
Title: Add new ``@consume_nargs`` decorator, allowing speciying number of consumed arguments

New :func:`tasks.consume_nargs` decorator, similar to :func:`tasks.consume_args` but accepting an argument:
the number of arguments that the decorated function will consume.
If no argument is passed to ``consume_nargs`` decorator, all comand-line arguments will be consumed.
:func:`tasks.consume_args` is now an alias for ``tasks.consume_nargs()``.

This should allow calls of multiple tasks with arguments (and only the last consuming all not yet consumed args).
For example in a ``pavement.py``::

@task
@consume_nargs(2)
def test1(options):
print options # should be ["1", "2"]

@task
@consume_nargs()
def test2(options):
print options # should be ["3", "4", "5"]

and call on command line::

paver test1 1 2 test2 3 4 5

Of course, as it's my first contrib to paver, I strongly recommend to carefully review these changes ^_^;)