Fermo.New.OptionParser behaviour (fermo_new v0.16.1) View Source

Link to this section Summary

Functions

Parse command-line arguments

Link to this section Functions

Parse command-line arguments

iex> Fermo.New.OptionParser.run(["/base/path"]) {:ok, %{base_path: "/base/path"}}

Locales can be supplied

iex> Fermo.New.OptionParser.run(["--locales", "en,it", "/base/path"]) {:ok, %{base_path: "/base/path", locales: ["en", "it"]}}

The base path is required

iex> Fermo.New.OptionParser.run(["--locales", "en,it"])

Locales need to be well formed

iex> Fermo.New.OptionParser.run(["--locales", "%%", "/base/path"])

Link to this section Callbacks

Specs

run([String.t()]) :: {:ok, map()} | {:error, atom(), String.t()}