Packages

Build robust, elegant CLIs with minimal boilerplate

Current section

Files

Jump to
mandate lib mix tasks mandate.gen.mix_task.ex
Raw

lib/mix/tasks/mandate.gen.mix_task.ex

defmodule Mix.Tasks.Mandate.Gen.MixTask do
use Mandate, as: :mix_task
shortdoc "Generates a new Mix Task"
argument :name, :string do
doc "Task name. Example: `my_app.my_task`"
required true
end
run fn args ->
IO.puts("Running my_task with: #{inspect(args)}")
end
end