Skip to content

Commit e45f052

Browse files
committed
Merge pull request #3725 from whatyouhide/mix-task-documentation-docs
Mention how to write docs for public Mix tasks
2 parents d76cc95 + f683c4e commit e45f052

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/mix/lib/mix/task.ex

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ defmodule Mix.Task do
1010
defmodule Mix.Tasks.Hello do
1111
use Mix.Task
1212
13-
def run(_) do
13+
def run(_args) do
1414
Mix.shell.info "hello"
1515
end
1616
end
@@ -27,6 +27,12 @@ defmodule Mix.Task do
2727
on `mix help`
2828
* `@recursive` - run the task recursively in umbrella projects
2929
30+
## Documentation
31+
32+
Users can read the documentation for public Mix tasks by doing `mix help
33+
my_task`. The documentation that will be showed is the `@moduledoc` of the
34+
task's module.
35+
3036
"""
3137

3238
@type task_name :: String.t | atom

0 commit comments

Comments
 (0)