summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFrancesco Mazzoli <francesco@rabbitmq.com>2012-05-21 15:40:26 +0100
committerFrancesco Mazzoli <francesco@rabbitmq.com>2012-05-21 15:40:26 +0100
commit4edc93aa0e0bca3bfe41fcd43e396bbce4f36b0c (patch)
tree0def368f045057d6c4a1f733debbc6ebe3b097b9 /src
parent7dfc71f3f2e9a9acc95133ef4429d50045f06371 (diff)
downloadrabbitmq-server-git-4edc93aa0e0bca3bfe41fcd43e396bbce4f36b0c.tar.gz
convert to list at the beginning
Diffstat (limited to 'src')
-rw-r--r--src/rabbit_misc.erl7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/rabbit_misc.erl b/src/rabbit_misc.erl
index d3a567b0d0..9619cb0ad2 100644
--- a/src/rabbit_misc.erl
+++ b/src/rabbit_misc.erl
@@ -753,7 +753,10 @@ gb_trees_foreach(Fun, Tree) ->
%% Returns either {ok, {atom(), [{string(), string()}], [string()]} which are
%% respectively the command, the key-value pairs of the options and the leftover
%% arguments; or no_command if no command could be parsed.
-get_options(CommandsOpts, GlobalOpts, Defs, As0) ->
+get_options(CommandsOpts0, GlobalOpts, Defs, As0) ->
+ CommandsOpts = lists:map(fun ({C, Fs}) -> {atom_to_list(C), Fs};
+ (C) -> {atom_to_list(C), []}
+ end, CommandsOpts0),
DefsDict = dict:from_list(Defs),
lists:foldl(fun ({C, Os}, no_command) ->
process_opts(C, DefsDict, GlobalOpts ++ Os, As0);
@@ -773,7 +776,7 @@ process_opts(C, Defs0, Opts0, As) ->
KVs1 = dict:map(fun (_, flag) -> false;
(_, {option, V}) -> V
end, Defs),
- case process_opts1(atom_to_list(C), Defs, KVs1, As) of
+ case process_opts1(C, Defs, KVs1, As) of
no_command -> no_command;
{ok, {KVs2, As1}} -> {ok, {list_to_atom(C), dict:to_list(KVs2), As1}}
end.