summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon MacMullen <simon@rabbitmq.com>2014-09-17 13:35:17 +0100
committerSimon MacMullen <simon@rabbitmq.com>2014-09-17 13:35:17 +0100
commit1c086dbfb840b341d54f8709208b93ba47c31a95 (patch)
treec4611c518e23d003c96408e5095e672493ab71fd
parent996fc2272f134264a44bcf96a43d971d861d11c9 (diff)
downloadrabbitmq-server-1c086dbfb840b341d54f8709208b93ba47c31a95.tar.gz
Specs for the spec god!
-rw-r--r--src/rabbit_cli.erl13
-rw-r--r--src/rabbit_misc.erl5
2 files changed, 12 insertions, 6 deletions
diff --git a/src/rabbit_cli.erl b/src/rabbit_cli.erl
index 0c19c727..2981f3b2 100644
--- a/src/rabbit_cli.erl
+++ b/src/rabbit_cli.erl
@@ -24,14 +24,17 @@
-ifdef(use_specs).
-type(optdef() :: flag | {option, string()}).
+-type(parse_result() :: {'ok', {atom(), [{string(), string()}], [string()]}} |
+ 'no_command').
+
+-spec(main/3 :: (fun (([string()], string()) -> parse_result()),
+ fun ((atom(), atom(), [any()], [any()]) -> any()),
+ atom()) -> no_return()).
+-spec(usage/1 :: (atom()) -> no_return()).
-spec(parse_arguments/4 ::
([{atom(), [{string(), optdef()}]} | atom()],
- [{string(), optdef()}],
- string(),
- [string()])
- -> {'ok', {atom(), [{string(), string()}], [string()]}} |
- 'no_command').
+ [{string(), optdef()}], string(), [string()]) -> parse_result()).
-endif.
diff --git a/src/rabbit_misc.erl b/src/rabbit_misc.erl
index 3696698c..84a00f0d 100644
--- a/src/rabbit_misc.erl
+++ b/src/rabbit_misc.erl
@@ -125,8 +125,11 @@
rabbit_types:r(any()), [binary()]) ->
'ok' | rabbit_types:connection_exit()).
-spec(assert_field_equivalence/4 ::
- (any(), any(), rabbit_types:r(any()), atom()) ->
+ (any(), any(), rabbit_types:r(any()), atom() | binary()) ->
'ok' | rabbit_types:connection_exit()).
+-spec(equivalence_fail/4 ::
+ (any(), any(), rabbit_types:r(any()), atom() | binary()) ->
+ rabbit_types:connection_exit()).
-spec(dirty_read/1 ::
({atom(), any()}) -> rabbit_types:ok_or_error2(any(), 'not_found')).
-spec(table_lookup/2 ::