Skip to content

Commit

Permalink
Pretty print the versioned dependences in describe-app.
Browse files Browse the repository at this point in the history
  • Loading branch information
jdavisp3 committed Mar 25, 2008
1 parent 240e8cd commit 75b7589
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/faxien/src/fax_manage.erl
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,8 @@ format_app_val(registered, Val) ->
format_atom_list(Val);
format_app_val(vsn, Val) ->
format_app_string(Val);
format_app_val(versioned_dependencies, Val) ->
join([format_versioned_dependency(Dep) || Dep <- Val], "\n");
format_app_val(_Key, Val) ->
io_lib:format(" ~p", [Val]).

Expand All @@ -555,6 +557,13 @@ format_atom_list(Atoms) ->
Words = join([erlang:atom_to_list(A) || A <- Atoms], ","),
wrap(Words, 60, " ").

format_versioned_dependency({Pkg, Ver}) ->
io_lib:format(" ~p == ~s", [Pkg, Ver]);
format_versioned_dependency({Pkg, Ver, gte}) ->
io_lib:format(" ~p >= ~s", [Pkg, Ver]);
format_versioned_dependency(Dep) ->
io_lib:format(" ~p", [Dep]).

%%--------------------------------------------------------------------
%% @private
%% @doc Join list terms together with a separator.
Expand Down

0 comments on commit 75b7589

Please sign in to comment.