Skip to content

Conversation

tyzhnenko
Copy link

Example for a task that raises InvalidUsageException

@task
def invalid_usage_exception(c):
    from invoke import InvalidUsageException

    raise InvalidUsageException("Invalid task usage!")
Task invalid_usage_exception usage error: Invalid task usage!

Usage: invoke [--core-opts] invalid-usage-exception [other tasks here ...]

Docstring:
  none

Options:
  none

Example for a task that is called with absent parameter

@task(positional=["pos1", "pos2"])
def two_positionals(c, pos1, pos2, nonpos):
    pass
Usage: invoke [--core-opts] two-positionals [--options] [other tasks here ...]

Docstring:
  none

Options:
  -n STRING, --nonpos=STRING
  -o STRING, --pos2=STRING
  -p STRING, --pos1=STRING

'two-positionals' did not receive required positional arguments: 'pos1', 'pos2'

Issue: #857

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant