cat-bookmarker/deps/ecto/lib/mix/tasks/ecto.ex

31 lines
696 B
Elixir
Raw Normal View History

2024-03-10 18:52:04 +00:00
defmodule Mix.Tasks.Ecto do
use Mix.Task
@shortdoc "Prints Ecto help information"
@moduledoc """
Prints Ecto tasks and their information.
$ mix ecto
"""
@impl true
def run(args) do
{_opts, args} = OptionParser.parse!(args, strict: [])
case args do
[] -> general()
_ -> Mix.raise "Invalid arguments, expected: mix ecto"
end
end
defp general() do
Application.ensure_all_started(:ecto)
Mix.shell().info "Ecto v#{Application.spec(:ecto, :vsn)}"
Mix.shell().info "A toolkit for data mapping and language integrated query for Elixir."
Mix.shell().info "\nAvailable tasks:\n"
Mix.Tasks.Help.run(["--search", "ecto."])
end
end