In a basic implementation the task module must define a run/1
function that takes a list of arguments. E.g. def run(args) do ... end
defmodule Mix.Tasks.Example_Task do
use Mix.Task
@shortdoc "Example_Task prints hello + its arguments"
def run(args) do
IO.puts "Hello #{args}"
end
end
Compile and run:
$ mix example_task world
"hello world"