diff options
author | Fred Hebert <mononcqc@ferd.ca> | 2017-01-21 21:42:26 -0500 |
---|---|---|
committer | Fred Hebert <mononcqc@ferd.ca> | 2017-01-21 21:42:26 -0500 |
commit | 004c808e97f84211b3099ee26f33d6a51295d28b (patch) | |
tree | 3e7205d87e76b2680bc39bd71736ca2bd6f6bf99 /manpages/commands | |
parent | 6a1cfaf9483e93b5410a21e4967d53f0ecf4b3c0 (diff) |
Add manpage for rebar3
With peer script to help autogenerate commands from providers
Diffstat (limited to 'manpages/commands')
-rw-r--r-- | manpages/commands | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/manpages/commands b/manpages/commands new file mode 100644 index 0000000..b4db50a --- /dev/null +++ b/manpages/commands @@ -0,0 +1,25 @@ +f(), +P = application:get_env(rebar, providers, []), +S = lists:foldl(fun(P, S) -> {ok, S2} = P:init(S), S2 end, rebar_state:new(), P), +PS = rebar_state:providers(S), +DP = lists:keysort(2,providers:get_providers_by_namespace(default, PS)), +f(Str), +Str = [begin + Name = element(2,Pn), + Desc = element(8,Pn), + Opts = element(10,Pn), + OptShort = [case {Short,Long} of + {undefined,undefined} -> ""; + {undefined,_} -> ["[\\fI--",Long,"\\fR] "]; + {_,undefined} -> ["[\\fI-",Short,"\\fR] "]; + {_,_} -> ["[\\fI-",Short,"\\fR|\\fI--",Long,"\\fR] "] + end || {_,Short,Long,_,_Desc} <- Opts], + OptLong = [case {Short,Long} of + {undefined,undefined} -> ""; + {_,undefined} -> [".IP\n\\fI-",Short,"\\fR: ", Desc, "\n"]; + {_,_} -> [".IP\n\\fI--",Long,"\\fR: ", Desc, "\n"] + end || {_,Short,Long,_,Desc} <- Opts], + [".TP\n", + "\\fB", atom_to_list(element(2,Pn)), "\\fR ", OptShort, "\n", + Desc, "\n", OptLong] end || Pn <- DP, element(5,Pn) == true], +file:write_file("commands.out", Str). |