summaryrefslogtreecommitdiff
path: root/src/rebar.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/rebar.erl')
-rw-r--r--src/rebar.erl91
1 files changed, 54 insertions, 37 deletions
diff --git a/src/rebar.erl b/src/rebar.erl
index 00505be..36a7b36 100644
--- a/src/rebar.erl
+++ b/src/rebar.erl
@@ -87,7 +87,9 @@ run(["help"|RawCmds]) when RawCmds =/= [] ->
run(["help"]) ->
help();
run(["info"|_]) ->
- help();
+ %% Catch calls to 'rebar info' to avoid treating plugins' info/2 functions
+ %% as commands.
+ ?CONSOLE("Command 'info' not understood or not applicable~n", []);
run(["version"]) ->
ok = load_rebar_app(),
%% Display vsn and build time info
@@ -178,14 +180,26 @@ run_aux(BaseConfig, Commands) ->
%%
help() ->
OptSpecList = option_spec_list(),
- getopt:usage(OptSpecList, "rebar",
- "[var=value,...] <command,...>",
- [{"var=value", "rebar global variables (e.g. force=1)"},
- {"command", "Command to run (e.g. compile)"}]),
+ rebar_getopt:usage(OptSpecList, "rebar",
+ "[var=value,...] <command,...>",
+ [{"var=value", "rebar global variables (e.g. force=1)"},
+ {"command", "Command to run (e.g. compile)"}]),
+
+ ?CONSOLE("To see a list of built-in commands, execute rebar -c.~n~n", []),
?CONSOLE(
"Type 'rebar help <CMD1> <CMD2>' for help on specific commands."
"~n~n", []),
?CONSOLE(
+ "rebar allows you to abbreviate the command to run:~n"
+ "$ rebar co # same as rebar compile~n"
+ "$ rebar eu # same as rebar eunit~n"
+ "$ rebar g-d # same as rebar get-deps~n"
+ "$ rebar x eu # same as rebar xref eunit~n"
+ "$ rebar l-d # same as rebar list-deps~n"
+ "$ rebar l-d l-t # same as rebar list-deps list-templates~n"
+ "$ rebar list-d l-te # same as rebar list-deps list-templates~n"
+ "~n", []),
+ ?CONSOLE(
"Core rebar.config options:~n"
" ~p~n"
" ~p~n"
@@ -215,7 +229,7 @@ help() ->
parse_args(RawArgs) ->
%% Parse getopt options
OptSpecList = option_spec_list(),
- case getopt:parse(OptSpecList, RawArgs) of
+ case rebar_getopt:parse(OptSpecList, RawArgs) of
{ok, Args} ->
Args;
{error, {Reason, Data}} ->
@@ -331,51 +345,54 @@ show_info_maybe_halt(O, Opts, F) ->
%%
commands() ->
S = <<"
-clean Clean
-compile Compile sources
+clean Clean
+compile Compile sources
-escriptize Generate escript archive
+escriptize Generate escript archive
-create template= [var=foo,...] Create skel based on template and vars
-create-app [appid=myapp] Create simple app skel
-create-lib [libid=mylib] Create simple lib skel
-create-node [nodeid=mynode] Create simple node skel
-list-templates List available templates
+create template= [var=foo,...] Create skel based on template and vars
+create-app [appid=myapp] Create simple app skel
+create-lib [libid=mylib] Create simple lib skel
+create-node [nodeid=mynode] Create simple node skel
+list-templates List available templates
-doc Generate Erlang program documentation
+doc Generate Erlang program documentation
-check-deps Display to be fetched dependencies
-get-deps Fetch dependencies
-update-deps Update fetched dependencies
-delete-deps Delete fetched dependencies
-list-deps List dependencies
+check-deps Display to be fetched dependencies
+get-deps Fetch dependencies
+update-deps Update fetched dependencies
+delete-deps Delete fetched dependencies
+list-deps List dependencies
-generate [dump_spec=0/1] Build release with reltool
-overlay Run reltool overlays only
+generate [dump_spec=0/1] Build release with reltool
+overlay Run reltool overlays only
generate-upgrade previous_release=path Build an upgrade package
generate-appups previous_release=path Generate appup files
-eunit [suites=foo] Run eunit tests in foo.erl and
- test/foo_tests.erl
- [suites=foo] [tests=bar] Run specific eunit tests [first test name
- starting with 'bar' in foo.erl and
- test/foo_tests.erl]
- [tests=bar] For every existing suite, run the first
- test whose name starts with bar and, if
- no such test exists, run the test whose
- name starts with bar in the suite's
- _tests module
+eunit [suite[s]=foo] Run EUnit tests in foo.erl and
+ test/foo_tests.erl
+ [suite[s]=foo] [test[s]=bar] Run specific EUnit tests [first test
+ name starting with 'bar' in foo.erl
+ and test/foo_tests.erl]
+ [test[s]=bar] For every existing suite, run the first
+ test whose name starts with bar and, if
+ no such test exists, run the test whose
+ name starts with bar in the suite's
+ _tests module.
+ [random_suite_order=true] Run tests in a random order, either
+ [random_suite_order=Seed] with a random seed for the PRNG, or a
+ specific one.
-ct [suites=] [case=] Run common_test suites
+ct [suite[s]=] [case=] Run common_test suites
-qc Test QuickCheck properties
+qc Test QuickCheck properties
-xref Run cross reference analysis
+xref Run cross reference analysis
-help Show the program options
-version Show version information
+help Show the program options
+version Show version information
">>,
io:put_chars(S).