Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Print out caveats on 'fetch' if any available.

  • Loading branch information...
commit 44b34199d7a8d5a343436f05b1c68beaf1a8c9a7 1 parent 1bb458c
@yrashk yrashk authored
Showing with 11 additions and 2 deletions.
  1. +2 −0  include/agner_spec.hrl
  2. +9 −2 src/agner.erl
View
2  include/agner_spec.hrl
@@ -15,6 +15,7 @@
{license, string()}.
-type agner_spec_property_erlang_versions() :: {erlang_versions, list(atom())}.
-type agner_spec_property_applications() :: {applications, list(atom())}.
+-type agner_spec_property_caveats() :: {caveats, string()}.
-type agner_spec_property_url() :: {url,
{git, url(), git_ref()} |
{hg, url(), hg_rev()}}.
@@ -29,6 +30,7 @@
agner_spec_property_license() |
agner_spec_property_erlang_versions() |
agner_spec_property_applications() |
+ agner_spec_property_caveats() |
agner_spec_property_url().
-type agner_spec() :: list(agner_spec_property()).
View
11 src/agner.erl
@@ -95,8 +95,15 @@ main(["fetch"|Args]) ->
undefined ->
io:format("ERROR: Package name required.~n");
Package ->
- io:format("~p~n",[fetch(Package,proplists:get_value(version, Opts),
- proplists:get_value(directory, Opts, Package))])
+ Version = proplists:get_value(version, Opts),
+ io:format("~p~n",[fetch(Package,Version,
+ proplists:get_value(directory, Opts, Package))]),
+ case proplists:get_value(caveats, spec(Package, Version)) of
+ undefined ->
+ ignore;
+ Caveats when is_list(Caveats) ->
+ io:format("=== CAVEATS ===~n~n~s~n~n",[Caveats])
+ end
end,
stop();
Please sign in to comment.
Something went wrong with that request. Please try again.