Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show task help for InvalidUsageException and incorrect params #931

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

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