diff options
author | Fred Hebert <mononcqc@ferd.ca> | 2016-12-23 14:17:13 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-23 14:17:13 -0500 |
commit | 768a7c5c3096583059ae036b40fbe9c692d5eebe (patch) | |
tree | 7767e6f7d1ecb7c4341c693cb04aac293386a0cd /src/rebar_dist_utils.erl | |
parent | a1a8387a191514ac0b939c23d10e34b49480dfd8 (diff) | |
parent | 8ae17c483d86f151d69091546b3577381662e27e (diff) |
Merge pull request #1391 from ferd/doc-and-types
Type specifications and edocs improvements
Diffstat (limited to 'src/rebar_dist_utils.erl')
-rw-r--r-- | src/rebar_dist_utils.erl | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/rebar_dist_utils.erl b/src/rebar_dist_utils.erl index f462826..93edf9d 100644 --- a/src/rebar_dist_utils.erl +++ b/src/rebar_dist_utils.erl @@ -7,6 +7,9 @@ %%%%%%%%%%%%%%%%%% %%% PUBLIC API %%% %%%%%%%%%%%%%%%%%% + +%% @doc allows to pick whether to use a short or long name, and +%% starts the distributed mode for it. -spec either(Name::atom(), SName::atom(), Opts::[{setcookie,term()}]) -> atom(). either(undefined, undefined, _) -> 'nonode@nohost'; @@ -19,13 +22,19 @@ either(undefined, SName, Opts) -> either(_, _, _) -> ?ABORT("Cannot have both short and long node names defined", []). +%% @doc starts a node with a short name. +-spec short(SName::atom(), Opts::[{setcookie,term()}]) -> term(). short(Name, Opts) -> start(Name, shortnames, Opts). +%% @doc starts a node with a long name. +-spec long(Name::atom(), Opts::[{setcookie,term()}]) -> term(). long(Name, Opts) -> start(Name, longnames, Opts). --spec find_options(rebar_state:state()) -> {Long, Short, Opts} when +%% @doc utility function to extract all distribution options +%% from a rebar3 state tuple. +-spec find_options(rebar_state:t()) -> {Long, Short, Opts} when Long :: atom(), Short :: atom(), Opts :: [{setcookie,term()}]. |