diff options
author | Eric Merritt <[email protected]> | 2013-09-20 15:29:30 -0700 |
---|---|---|
committer | Eric Merritt <[email protected]> | 2013-09-20 15:29:30 -0700 |
commit | 8da020ccdccc9da37d8accaabe9fab0ab1e825dd (patch) | |
tree | f01a4e30515c87cd7e6a8e38c010b83806cda105 /src/relx.erl | |
parent | a23fc9028f1914f7dc680a443e35cf47d347365d (diff) | |
parent | 6df9d493655775677400ca0348de747d90305256 (diff) | |
download | relx-8da020ccdccc9da37d8accaabe9fab0ab1e825dd.tar.gz relx-8da020ccdccc9da37d8accaabe9fab0ab1e825dd.tar.bz2 relx-8da020ccdccc9da37d8accaabe9fab0ab1e825dd.zip |
Merge pull request #44 from tsloughter/master
allow template for sys.config and vm.args add lib_dirs config option
Diffstat (limited to 'src/relx.erl')
-rw-r--r-- | src/relx.erl | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/relx.erl b/src/relx.erl index bc3fbaa..2aac8e4 100644 --- a/src/relx.erl +++ b/src/relx.erl @@ -47,11 +47,18 @@ main(Args) -> OptSpecList = opt_spec_list(), Result = case getopt:parse(OptSpecList, Args) of {ok, {Options, NonOptions}} -> - case lists:member(help, Options) of + case lists:member(version, Options) of true -> - usage(); + application:load(relx), + {ok, Vsn} = application:get_key(relx, vsn), + io:format("~s~n", [Vsn]); false -> - do([{caller, command_line} | Options], NonOptions) + case lists:member(help, Options) of + true -> + usage(); + false -> + do([{caller, command_line} | Options], NonOptions) + end end; {error, Detail} -> ?RLX_ERROR({opt_parse, Detail}) @@ -182,7 +189,9 @@ opt_spec_list() -> {help, $h, "help", undefined, "Print usage"}, {lib_dir, $l, "lib-dir", string, - "Additional dirs that should be searched for OTP Apps"}, + "Additional dir that should be searched for OTP Apps"}, + {path, $p, "path", string, + "Additional dir to add to the code path"}, {disable_default_libs, undefined, "disable-default-libs", {boolean, false}, "Disable the default system added lib dirs (means you must add them all manually"}, @@ -191,6 +200,7 @@ opt_spec_list() -> {override_app, $a, "override_app", string, "Provide an app name and a directory to override in the form <appname>:<app directory>"}, {config, $c, "config", {string, ""}, "The path to a config file"}, + {version, $v, "version", undefined, "Print relx version"}, {root_dir, $r, "root", string, "The project root directory"}]. -spec format_error(Reason::term()) -> string(). |