Skip to content

Commit c0af262

Browse files
author
José Valim
committed
List iex -S mix at the bottom of mix help
1 parent 6b511cc commit c0af262

File tree

3 files changed

+11
-33
lines changed

3 files changed

+11
-33
lines changed

lib/mix/lib/mix/tasks/help.ex

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ defmodule Mix.Tasks.Help do
2323

2424
docs = lc module inlist modules,
2525
doc = Mix.Task.shortdoc(module) do
26-
{ Mix.Task.task_name(module), doc }
26+
{ "mix " <> Mix.Task.task_name(module), doc }
2727
end
2828

2929
max = Enum.reduce docs, 0, fn({ task, _ }, acc) ->
@@ -32,11 +32,11 @@ defmodule Mix.Tasks.Help do
3232

3333
display_default_task_doc(max)
3434

35-
sorted = Enum.sort(docs)
36-
37-
Enum.each sorted, fn({ task, doc }) ->
35+
Enum.each Enum.sort(docs), fn({ task, doc }) ->
3836
shell.info format_task(task, max, doc)
3937
end
38+
39+
display_iex_task_doc(max)
4040
end
4141

4242
def run([task]) do
@@ -54,7 +54,7 @@ defmodule Mix.Tasks.Help do
5454
end
5555

5656
defp format_task(task, max, doc) do
57-
"mix " <> String.ljust(task, max) <> " # " <> doc
57+
String.ljust(task, max) <> " # " <> doc
5858
end
5959

6060
defp where_is_file(module) do
@@ -65,7 +65,12 @@ defmodule Mix.Tasks.Help do
6565
end
6666

6767
defp display_default_task_doc(max) do
68-
Mix.shell.info format_task("", max,
68+
Mix.shell.info format_task("mix", max,
6969
"Run the default task (current: mix #{Mix.project[:default_task]})")
7070
end
71+
72+
defp display_iex_task_doc(max) do
73+
Mix.shell.info format_task("iex -S mix", max,
74+
"Start IEx and run the default task")
75+
end
7176
end

lib/mix/lib/mix/tasks/iex.ex

Lines changed: 0 additions & 12 deletions
This file was deleted.

lib/mix/test/mix/tasks/iex_test.exs

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)