View Source mix mobilizon.common (Mobilizon v4.1.0-alpha.1)

Common functions to be reused in mix tasks

Summary

Types

@type task_module() :: atom()

Functions

@spec escape_sh_path(String.t()) :: String.t()
Link to this function

get_option(options, opt, prompt, defval \\ nil, defname \\ nil)

View Source
@spec get_option(Keyword.t(), atom(), String.t(), String.t() | nil, String.t() | nil) ::
  any()
Link to this function

list_subtasks_for_module(module_name)

View Source
@spec list_subtasks_for_module(module()) :: [{String.t(), String.t()}]
@spec mix_shell?() :: boolean()

Performs a safe check whether Mix.shell/0 is available (does not raise if Mix is not loaded)

@spec mix_task?() :: boolean()
Link to this function

shell_error(message, options \\ [])

View Source
@spec shell_error(String.t(), Keyword.t()) :: nil | no_return()
@spec shell_info(String.t()) :: :ok
Link to this function

shell_prompt(prompt, defval \\ nil, defname \\ nil)

View Source
@spec shell_prompt(String.t(), String.t() | nil, String.t() | nil) :: String.t()
@spec shell_yes?(String.t()) :: boolean()
@spec shortdoc(task_module()) :: String.t() | nil

Gets the shortdoc for the given task module. Returns the shortdoc or nil.

Link to this function

show_subtasks_for_module(module_name)

View Source
@spec show_subtasks_for_module(module()) :: :ok
@spec start_mobilizon() :: any()