Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion lib/mix/lib/mix/local/installer.ex
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,10 @@ defmodule Mix.Local.Installer do
nil
end
else
Mix.raise("No argument was given to uninstall command")
Mix.raise(
"No argument was given to uninstall command. " <>
" Use \"mix archive.uninstall PATH\" or run \"mix help archive.uninstall\" for more information"
)
end
end

Expand Down
2 changes: 1 addition & 1 deletion lib/mix/lib/mix/tasks/cmd.ex
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ defmodule Mix.Tasks.Cmd do
{opts, args} = OptionParser.parse_head!(args, strict: @switches)

if args == [] do
Mix.raise("Expected at least one argument in mix cmd")
Mix.raise("No argument was given to mix cmd. Run \"mix help cmd\" for more information")
end

apps =
Expand Down
3 changes: 2 additions & 1 deletion lib/mix/lib/mix/tasks/escript.build.ex
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,8 @@ defmodule Mix.Tasks.Escript.Build do
if !main do
error_message =
"Could not generate escript, please set :main_module " <>
"in your project configuration (under :escript option) to a module that implements main/1"
"in your project configuration (under :escript option) to a module that implements main/1. " <>
"Run \"mix help escript.build\" for more information"

Mix.raise(error_message)
end
Expand Down
5 changes: 4 additions & 1 deletion lib/mix/lib/mix/tasks/eval.ex
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,10 @@ defmodule Mix.Tasks.Eval do
end

_ ->
Mix.raise("\"mix eval\" expects a single string to evaluate as argument")
Mix.raise(
"\"mix eval\" expects a single string to evaluate as argument. " <>
"Run \"mix help eval\" for more information"
)
end
end
end
5 changes: 4 additions & 1 deletion lib/mix/lib/mix/tasks/new.ex
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@ defmodule Mix.Tasks.New do

case argv do
[] ->
Mix.raise("Expected PATH to be given, please use \"mix new PATH\"")
Mix.raise(
"Expected PATH to be given. " <>
"Use \"mix new PATH\" or run \"mix help new\" for more information"
)

[path | _] ->
app = opts[:app] || Path.basename(Path.expand(path))
Expand Down
4 changes: 3 additions & 1 deletion lib/mix/lib/mix/tasks/xref.ex
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,9 @@ defmodule Mix.Tasks.Xref do
)

_ ->
Mix.raise("xref doesn't support this command. For more information run \"mix help xref\"")
Mix.raise(
"No argument was given to xref command. Run \"mix help xref\" for more information"
)
end
end

Expand Down
8 changes: 5 additions & 3 deletions lib/mix/test/mix/tasks/new_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,11 @@ defmodule Mix.Tasks.NewTest do
end)

in_tmp("new without a specified path", fn ->
assert_raise Mix.Error, "Expected PATH to be given, please use \"mix new PATH\"", fn ->
Mix.Tasks.New.run([])
end
assert_raise Mix.Error,
"Expected PATH to be given. Use \"mix new PATH\" or run \"mix help new\" for more information",
fn ->
Mix.Tasks.New.run([])
end
end)
end

Expand Down
3 changes: 2 additions & 1 deletion lib/mix/test/mix/tasks/xref_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,8 @@ defmodule Mix.Tasks.XrefTest do

test "no argument gives error" do
in_fixture("no_mixfile", fn ->
message = "xref doesn't support this command. For more information run \"mix help xref\""
message =
"No argument was given to xref command. Run \"mix help xref\" for more information"

assert_raise Mix.Error, message, fn ->
assert Mix.Task.run("xref", ["callers"]) == :error
Expand Down