aboutsummaryrefslogtreecommitdiffstats
path: root/src/relx.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/relx.erl')
-rw-r--r--src/relx.erl18
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().