Skip to content

Commit

Permalink
Fix type specs for usage registration.
Browse files Browse the repository at this point in the history
This was missed when the function form of usage was created, resulting
in the 'clique' module having a narrower spec than the 'clique_usage'
module. Prompted by basho/riak_repl#660.
  • Loading branch information
seancribbs committed Mar 11, 2015
1 parent ac00915 commit 007853b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/clique.erl
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ register_command(Cmd, Keys, Flags, Fun) ->

%% @doc Register usage for a given command sequence. Lookups are by longest
%% match.
-spec register_usage([string()], iolist()) -> true.
-spec register_usage([string()], clique_usage:usage()) -> true.
register_usage(Cmd, Usage) ->
clique_usage:register(Cmd, Usage).

Expand Down
5 changes: 4 additions & 1 deletion src/clique_usage.erl
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@

-type err() :: {error, term()}.
-type usage_function() :: fun(() -> iolist()).
-type usage() :: iolist() | usage_function().

-export_type([usage/0]).

%% API
-export([init/0,
Expand All @@ -42,7 +45,7 @@ init() ->

%% @doc Register usage for a given command sequence. Lookups are by longest
%% match.
-spec register([string()], iolist() | usage_function()) -> true.
-spec register([string()], usage()) -> true.
register(Cmd, Usage) ->
ets:insert(?usage_table, {Cmd, Usage}).

Expand Down

5 comments on commit 007853b

@borshop
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from andrewjstone
at 007853b

@borshop
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging basho/clique/bugfix/sdc/usage-types = 007853b into borshop-integration-55-bugfix/sdc/usage-types

@borshop
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

basho/clique/bugfix/sdc/usage-types = 007853b merged ok, testing candidate = 40072d2

@borshop
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@borshop
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding develop to borshop-integration-55-bugfix/sdc/usage-types = 40072d2

Please sign in to comment.