Skip to content

Instantly share code, notes, and snippets.

@blackode
Last active February 27, 2017 11:04
Show Gist options
  • Save blackode/8370b85db75ec4cbdb42a52c269a4128 to your computer and use it in GitHub Desktop.
Save blackode/8370b85db75ec4cbdb42a52c269a4128 to your computer and use it in GitHub Desktop.
task with short docs
defmodule Mix.Tasks.MyTasks.Functions do
use Mix.Task
@shortdoc "Returns functions in Module"
@moduledoc ~S"""
This is used to list out the all available functions in the module.
You suppose to pass module_name as parameter to the task.
#Usage
```
mix my_tasks.functins Hello
```
This list out all the functins in the module Hello
"""
def run([module_name]) do
module = Module.concat Elixir,module_name
data = apply(module, :__info__, [:functions])
IO.inspect data
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment