소스 검색

Merge pull request #336 from ferd/rework-wtf-provider

Rename wtf->report, add all dep versions
pull/340/head
Tristan Sloughter 10 년 전
부모
커밋
bd6d6206ca
5개의 변경된 파일20개의 추가작업 그리고 16개의 파일을 삭제
  1. +3
    -3
      priv/shell-completion/bash/rebar3
  2. +4
    -4
      priv/shell-completion/zsh/_rebar3
  3. +1
    -1
      src/rebar.app.src
  4. +2
    -2
      src/rebar3.erl
  5. +10
    -6
      src/rebar_prv_report.erl

+ 3
- 3
priv/shell-completion/bash/rebar3 파일 보기

@ -24,12 +24,12 @@ _rebar3()
new \ new \
pkgs \ pkgs \
release \ release \
report \
shell \ shell \
tar \ tar \
update \ update \
upgrade \ upgrade \
version \ version \
wtf \
xref" xref"
elif [[ ${prev} == as ]] ; then elif [[ ${prev} == as ]] ; then
: :
@ -115,6 +115,8 @@ _rebar3()
--system_libs \ --system_libs \
--version \ --version \
--root" --root"
elif [[ ${prev} == report ]] ; then
:
elif [[ ${prev} == shell ]] ; then elif [[ ${prev} == shell ]] ; then
: :
elif [[ ${prev} == tar ]] ; then elif [[ ${prev} == tar ]] ; then
@ -145,8 +147,6 @@ _rebar3()
: :
elif [[ ${prev} == version ]] ; then elif [[ ${prev} == version ]] ; then
: :
elif [[ ${prev} == wtf ]] ; then
:
elif [[ ${prev} == xref ]] ; then elif [[ ${prev} == xref ]] ; then
: :
fi fi

+ 4
- 4
priv/shell-completion/zsh/_rebar3 파일 보기

@ -131,6 +131,9 @@ _rebar3 () {
'(-r --root)'{-r,--root}'[The project root directory]:system libs:_files -/' \ '(-r --root)'{-r,--root}'[The project root directory]:system libs:_files -/' \
&& ret=0 && ret=0
;; ;;
(report)
_arguments '1: :_rebar3_tasks' && ret=0
;;
(shell) (shell)
_message 'Start a shell with project and deps preloaded' && ret=0 _message 'Start a shell with project and deps preloaded' && ret=0
;; ;;
@ -168,9 +171,6 @@ _rebar3 () {
(version) (version)
_message 'rebar version' && ret=0 _message 'rebar version' && ret=0
;; ;;
(wtf)
_arguments '1: :_rebar3_tasks' && ret=0
;;
(xref) (xref)
_message 'rebar xref' && ret=0 _message 'rebar xref' && ret=0
esac esac
@ -194,12 +194,12 @@ _rebar3_tasks() {
'new:Create new project from templates.' 'new:Create new project from templates.'
'pkgs:List available packages.' 'pkgs:List available packages.'
'release:Build release of project.' 'release:Build release of project.'
'report:Provide a crash report to be sent to the rebar3 issues page.'
'shell:Run shell with project apps and deps in path.' 'shell:Run shell with project apps and deps in path.'
'tar:Tar archive of release built of project.' 'tar:Tar archive of release built of project.'
'update:Update package index.' 'update:Update package index.'
'upgrade:Upgrade dependencies.' 'upgrade:Upgrade dependencies.'
'version:Print version for rebar and current Erlang.' 'version:Print version for rebar and current Erlang.'
'wtf:Provide a crash report to be sent to the rebar3 issues page.'
'xref:Run cross reference analysis.' 'xref:Run cross reference analysis.'
) )
_describe -t tasks 'rebar3 tasks' tasks "$@" _describe -t tasks 'rebar3 tasks' tasks "$@"

+ 1
- 1
src/rebar.app.src 파일 보기

@ -46,12 +46,12 @@
rebar_prv_new, rebar_prv_new,
rebar_prv_packages, rebar_prv_packages,
rebar_prv_release, rebar_prv_release,
rebar_prv_report,
rebar_prv_shell, rebar_prv_shell,
rebar_prv_tar, rebar_prv_tar,
rebar_prv_update, rebar_prv_update,
rebar_prv_upgrade, rebar_prv_upgrade,
rebar_prv_version, rebar_prv_version,
rebar_prv_wtf,
rebar_prv_xref]} rebar_prv_xref]}
]} ]}
]}. ]}.

+ 2
- 2
src/rebar3.erl 파일 보기

@ -55,7 +55,7 @@ main(Args) ->
non_existing -> non_existing ->
?ERROR("Uncaught error in rebar_core. Run with DEBUG=1 to see stacktrace", []), ?ERROR("Uncaught error in rebar_core. Run with DEBUG=1 to see stacktrace", []),
?DEBUG("Uncaught error: ~p ~p", [Module, Reason]), ?DEBUG("Uncaught error: ~p ~p", [Module, Reason]),
?INFO("When submitting a bug report, please include the output of `rebar3 wtf \"your command\"`", []);
?INFO("When submitting a bug report, please include the output of `rebar3 report \"your command\"`", []);
_ -> _ ->
?ERROR(Module:format_error(Reason), []) ?ERROR(Module:format_error(Reason), [])
end, end,
@ -68,7 +68,7 @@ main(Args) ->
%% Dump this error to console %% Dump this error to console
?ERROR("Uncaught error in rebar_core. Run with DEBUG=1 to see stacktrace", []), ?ERROR("Uncaught error in rebar_core. Run with DEBUG=1 to see stacktrace", []),
?DEBUG("Uncaught error: ~p", [Error]), ?DEBUG("Uncaught error: ~p", [Error]),
?INFO("When submitting a bug report, please include the output of `rebar3 wtf \"your command\"`", []),
?INFO("When submitting a bug report, please include the output of `rebar3 report \"your command\"`", []),
erlang:halt(1) erlang:halt(1)
end. end.

src/rebar_prv_wtf.erl → src/rebar_prv_report.erl 파일 보기

@ -1,7 +1,7 @@
%% -*- erlang-indent-level: 4;indent-tabs-mode: nil -*- %% -*- erlang-indent-level: 4;indent-tabs-mode: nil -*-
%% ex: ts=4 sw=4 et %% ex: ts=4 sw=4 et
-module(rebar_prv_wtf).
-module(rebar_prv_report).
-behaviour(provider). -behaviour(provider).
@ -11,7 +11,7 @@
-include("rebar.hrl"). -include("rebar.hrl").
-define(PROVIDER, wtf).
-define(PROVIDER, report).
-define(DEPS, []). -define(DEPS, []).
-define(ISSUES_URL, "https://github.com/rebar/rebar3/issues"). -define(ISSUES_URL, "https://github.com/rebar/rebar3/issues").
@ -25,7 +25,7 @@ init(State) ->
{module, ?MODULE}, {module, ?MODULE},
{bare, false}, {bare, false},
{deps, ?DEPS}, {deps, ?DEPS},
{example, "rebar3 wtf \"<task>\""},
{example, "rebar3 report \"<task>\""},
{short_desc, "Provide a crash report to be sent to the rebar3 issues page."}, {short_desc, "Provide a crash report to be sent to the rebar3 issues page."},
{desc, "Provide a crash report to be sent to the rebar3 issues page."}, {desc, "Provide a crash report to be sent to the rebar3 issues page."},
{opts, [ {opts, [
@ -42,7 +42,11 @@ do(State) ->
%% ... %% ...
%% Show app versions (including rebar3) %% Show app versions (including rebar3)
{ok, Vsn} = application:get_key(rebar, vsn), {ok, Vsn} = application:get_key(rebar, vsn),
Vsns = application:which_applications(),
{ok, Apps} = application:get_key(rebar, applications),
[application:ensure_started(App) || App <- Apps],
Vsns = [io_lib:format("~p: ~s~n", [App, AVsn])
|| App <- lists:sort(Apps),
{ok, AVsn} <- [application:get_key(App, vsn)]],
%% Show OS and versions %% Show OS and versions
OS = erlang:system_info(system_architecture), OS = erlang:system_info(system_architecture),
%% Erlang version (ERTS) %% Erlang version (ERTS)
@ -54,7 +58,7 @@ do(State) ->
UTC = calendar:universal_time(), UTC = calendar:universal_time(),
%% %%
?CONSOLE( ?CONSOLE(
"Rebar3 wtf report~n"
"Rebar3 report~n"
" version ~s~n" " version ~s~n"
" generated at ~s~n" " generated at ~s~n"
"=================~n" "=================~n"
@ -71,7 +75,7 @@ do(State) ->
"Library directory: ~ts~n" "Library directory: ~ts~n"
"-----------------~n" "-----------------~n"
"Loaded Applications:~n" "Loaded Applications:~n"
"~p~n"
"~s~n"
"-----------------~n" "-----------------~n"
"Escript path: ~ts~n" "Escript path: ~ts~n"
"Providers:~n" "Providers:~n"

불러오는 중...
취소
저장