From 004c808e97f84211b3099ee26f33d6a51295d28b Mon Sep 17 00:00:00 2001 From: Fred Hebert Date: Sat, 21 Jan 2017 21:42:26 -0500 Subject: Add manpage for rebar3 With peer script to help autogenerate commands from providers --- manpages/commands | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 manpages/commands (limited to 'manpages/commands') 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). -- cgit v1.1