Search code examples
elixirelixir-mix

Change the task name displayed by mix


Hello there I have a module like this one:

Mix.Tasks.MyModule.Release.Deploy

and when I run mix help it is displayed like this:

my_module.release.deploy

How can I change that to

mymodule.release.deploy

I tried to use Mix.Task.task_name/1:

def task_name(_) do
  "mymodule.release.deploy"
end

but with no success. Am I missing something there?


Solution

  • Indeed. CamelCase is translated to lowercase with underscores between two capital letters. If you want mymodule, you better write it Mymodule in the first place.