Breaking up & porting
This commit is contained in:
parent
24738f5278
commit
c47a88c319
25
src/zx.erl
25
src/zx.erl
@ -13,13 +13,21 @@
|
||||
%%% @end
|
||||
|
||||
-module(zx).
|
||||
-export([start/2, main/1]).
|
||||
-behavior(application).
|
||||
-author("Craig Everett <zxq9@zxq9.com>").
|
||||
-copyright("Craig Everett <zxq9@zxq9.com>").
|
||||
-license("GPL-3.0").
|
||||
|
||||
|
||||
-export([start/1, stop/0]).
|
||||
-export([start/2, stop/1]).
|
||||
|
||||
-export_type([serial/0, package_id/0, package/0, realm/0, name/0, version/0, option/0,
|
||||
host/0, key_id/0, key_name/0, user/0, username/0, lower0_9/0, label/0,
|
||||
package_meta/0]).
|
||||
|
||||
-include("zx_logger.hrl").
|
||||
|
||||
|
||||
-record(s,
|
||||
{realm = "otpr" :: realm(),
|
||||
@ -34,6 +42,9 @@
|
||||
mon = none :: none | reference()}).
|
||||
|
||||
|
||||
|
||||
%%% Type Definitions
|
||||
|
||||
-type state() :: #s{}.
|
||||
-type serial() :: integer().
|
||||
-type package_id() :: {realm(), name(), version()}.
|
||||
@ -58,18 +69,6 @@
|
||||
|
||||
|
||||
|
||||
-spec main(Args) -> no_return()
|
||||
when Args :: [string()].
|
||||
%% @private
|
||||
%% The automatically exposed function initially called by escript to kick things off.
|
||||
%% Args is a list of command-line provided arguments, all presented as a list of strings
|
||||
%% delimited by whitespace in the shell.
|
||||
|
||||
main(Args) ->
|
||||
ok = ensure_zomp_home(),
|
||||
start(Args).
|
||||
|
||||
|
||||
-spec start(Args) -> no_return()
|
||||
when Args :: [string()].
|
||||
%% Dispatch work functions based on the nature of the input arguments.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user