Add pre & post tasks to help output

Open
#860 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Stale
Tech stack
python
Domain
cli

Research direction

Start by tracing the help output for invoke --help serve and how task definitions in tasks.py expose pre- and post-tasks. Use the example output in the issue as the target, including empty sections where appropriate, and verify the displayed task relationships against a task that calls clean and build.

Written by the indexing model from the issue text.

Description

Feature Needs patch

It would be great if the help output for a task could include a list of pre & post tasks that this task calls. For example, if I have a serve task, that calls clean & build as pre-tasks, the help output could look something like this:

❯ inv --help serve

Usage: inv[oke] [--core-opts] serve [other tasks here ...]

Docstring:
  Serve thing at http://localhost:$DOCS_PORT/ & live reload on changes. Default port: 5500

Options:
  none

Pre-tasks:
  Calls clean, build

Post-tasks:
  none

Invoke does know this information, and it would be great to make it visible to users so they know what running a task will do - without having to look at the tasks.py code - on manually having to add this text to the docstring.

Dominant language
Python
Stars
4.8k
Forks
412
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from pyinvoke/invoke

All issues in pyinvoke/invoke

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.