zf

zenflows testing
git clone https://s.sonu.ch/~srfsh/zf.git
Log | Files | Refs | Submodules | README | LICENSE

ecto.ex (696B)


      1 defmodule Mix.Tasks.Ecto do
      2   use Mix.Task
      3 
      4   @shortdoc "Prints Ecto help information"
      5 
      6   @moduledoc """
      7   Prints Ecto tasks and their information.
      8 
      9       $ mix ecto
     10 
     11   """
     12 
     13   @impl true
     14   def run(args) do
     15     {_opts, args} = OptionParser.parse!(args, strict: [])
     16 
     17     case args do
     18       [] -> general()
     19       _ -> Mix.raise "Invalid arguments, expected: mix ecto"
     20     end
     21   end
     22 
     23   defp general() do
     24     Application.ensure_all_started(:ecto)
     25     Mix.shell().info "Ecto v#{Application.spec(:ecto, :vsn)}"
     26     Mix.shell().info "A toolkit for data mapping and language integrated query for Elixir."
     27     Mix.shell().info "\nAvailable tasks:\n"
     28     Mix.Tasks.Help.run(["--search", "ecto."])
     29   end
     30 end