View Source mix mod.new (modkit v0.5.1)

Creates a new module in the current application, based on a template.

The location of the new module is defined according to the :mount option in :modkit configuration defined in the project file (mix.exs).

If not defined, default mount points are defined as follows:

[
  {App, "lib/app"}
  {Mix.Tasks, "lib/mix/tasks", flavor: :mix_task}
]

usage

Usage

mix mod.new [options] <module>

options

Options

  • -d, --dynamic-supervisor - use DynamicSupervisor and define base functions
  • -g, --gen-server - use GenServer and define base functions
  • -o, --overwrite - Overwrite the file if it exists. Always prompt.
  • -p, --path - The path of the module to write. Unnecessary if the module prefix is mounted.
  • -s, --supervisor - use Supervisor and define base functions
  • --help - Displays this help.