Skip to content

Commit

Permalink
Make reformat-indexes print default parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
engelsanchez committed Apr 1, 2013
1 parent 3e1ec43 commit 1bfaeae
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/riak_kv_console.erl
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,17 @@ parse_int(IntStr) ->
end.

index_reformat_options([], Opts) ->
Opts;
Defaults = [{concurrency, 2}, {batch_size, 100}],
AddIfAbsent =
fun({Name,Val}, Acc) ->
case lists:keymember(Name, 1, Acc) of
true ->
Acc;
false ->
[{Name, Val} | Acc]
end
end,
lists:foldl(AddIfAbsent, Opts, Defaults);
index_reformat_options(["--downgrade"], Opts) ->
[{downgrade, true} | Opts];
index_reformat_options(["--downgrade" | More], _Opts) ->
Expand Down

0 comments on commit 1bfaeae

Please sign in to comment.